【发布时间】:2014-08-15 05:36:49
【问题描述】:
我使用 MVC 5 创建了我的第一个网站,它在我的本地机器上运行良好,但是当我将它发布到服务器时,一些 CSS 没有正确缩小。
/* Minification failed. Returning unminified contents.
(80,1): run-time error CSS1019: Unexpected token, found '@import'
(80,9): run-time error CSS1019: Unexpected token, found 'url('../Content/dark-skin/skin.css')'
(671,16): run-time error CSS1062: Expected semicolon or closing curly-brace, found ':'
(1288,16): run-time error CSS1062: Expected semicolon or closing curly-brace, found ':'
(1680,1): run-time error CSS1019: Unexpected token, found '@keyframes'
(1682,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '50%'
(1685,1): run-time error CSS1019: Unexpected token, found '@-webkit-keyframes'
(1687,5): run-time error CSS1062: Expected semicolon or closing curly-brace, found '50%'
*/
/* NUGET: BEGIN LICENSE TEXT
*
* Microsoft grants you the right to use these script files for the sole
* purpose of either: (i) interacting through your browser with the Microsoft
* website or online service, subject to the applicable licensing or use
* terms; or (ii) using the files as included with a Microsoft product subject
* to that product's license terms. Microsoft reserves all other rights to the
* files not expressly granted by Microsoft, whether by implication, estoppel
* or otherwise. The notices and licenses below are for informational purposes only.
*
* NUGET: END LICENSE TEXT */
/*!
* Bootstrap v3.0.0
*
* Copyright 2013 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world by @mdo and @fat.
*//*! normalize.css v2.1.0 | MIT License | git.io/normalize */
尝试更正一些错误并再次发布后,错误看起来相同。
最奇怪的部分是bootstrap.css,为了网站的目的,我稍微修改了它。当我发布它时,更改不在捆绑文件中。是否有可能从 Bootstrap 服务器而不是我的项目加载引导程序?
bundles.Add(new StyleBundle("~/Content/cssmain").Include(
"~/Content/bootstrap.css",
"~/Content/site.css",
"~/Content/ilightbox.css",
"~/Content/bannerscollection_zoominout.css"));
我也尝试使用 Web 应用程序自己进行缩小,但我的更改不可见,并且文件似乎没有被缩小。
感谢任何帮助。
【问题讨论】:
标签: asp.net asp.net-mvc bundling-and-minification