MVC4捆绑:微小失败,因为CSS3的特征? [英] MVC4 bundling: Minification failed because of css3-feature?

查看:293
本文介绍了MVC4捆绑:微小失败,因为CSS3的特征?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用MVC4捆绑和缩小,但我总是得到这个错误信息在我不缩小的CSS文件注释:

  / *缩小失败。返回unminified内容。
(534,29):运行时错误CSS1019:意外的令牌,发现''
(534,29):运行时错误CSS1019:意外的令牌,发现''
(534,29):运行时错误CSS1042:预期功能,发现''
(534,29):运行时错误CSS1062:预计分号或关闭大括号,发现''
(535,26):运行时错误CSS1019:意外的令牌,发现''
(535,26):运行时错误CSS1019:意外的令牌,发现''
(535,26):运行时错误CSS1042:预期功能,发现''
(535,26):运行时错误CSS1062:预计分号或关闭大括号,发现''
(536,25):运行时错误CSS1019:意外的令牌,发现''
(536,25):运行时错误CSS1019:意外的令牌,发现''
(536,25):运行时错误CSS1042:预期功能,发现''
(536,25):运行时错误CSS1062:预计分号或关闭大括号,发现''
(537,24):运行时错误CSS1019:意外的令牌,发现''
(537,24):运行时错误CSS1019:意外的令牌,发现''
(537,24):运行时错误CSS1042:预期功能,发现''
(537,24):运行时错误CSS1062:预计分号或关闭大括号,发现''
 * /

在CSS对应的线路有:

 宽度:-webkit-计算(100% -  0.5em);
宽度:-moz-计算(100% - 0.5em);
宽度:-ms-计算(100% - 0.5em);
宽度:-o-计算(100% - 0.5em);

我能为缩小与CSS3的计算功能来工作?


解决方案

我不知道,你就可以在当前的实现来使用它。我认为你有两件事情对工作你在这里。


  1. http://www.w3.org/standards/techs/ CSS#w3c_all 的几乎一切仍是一个工作草案。这可能是不值得实施 System.Web.Optimization 的东西,如果它要发生变化,并导致长期更多的问题的努力。


  2. 钙()目前除的 CSS值和单位模块级3 其中规定:


      

    下面的功能是有风险的,并可能在CR期间被丢弃。钙(),切换()','ATTR()'。



因此​​,与那些事情,微软可能不会对CSS3的最前沿。诚然,自认为语法不是完全在墙上,这是很有可能的错误更多。希望他们开源 System.Web.Optimization 很快这样人们就可以解决这样的问题。但他们一直看好,现在开源它近一年。

在此期间,你可以尝试prebundle的文件在本地的机器上,你有很多在它的控制。或者,也许尝试不同的捆绑/缩小系统如

I want to use MVC4 bundling and minification, but I always get this error message as comment in my not minified css file:

/* Minification failed. Returning unminified contents.
(534,29): run-time error CSS1019: Unexpected token, found ' '
(534,29): run-time error CSS1019: Unexpected token, found ' '
(534,29): run-time error CSS1042: Expected function, found ' '
(534,29): run-time error CSS1062: Expected semicolon or closing curly-brace, found ' '
(535,26): run-time error CSS1019: Unexpected token, found ' '
(535,26): run-time error CSS1019: Unexpected token, found ' '
(535,26): run-time error CSS1042: Expected function, found ' '
(535,26): run-time error CSS1062: Expected semicolon or closing curly-brace, found ' '
(536,25): run-time error CSS1019: Unexpected token, found ' '
(536,25): run-time error CSS1019: Unexpected token, found ' '
(536,25): run-time error CSS1042: Expected function, found ' '
(536,25): run-time error CSS1062: Expected semicolon or closing curly-brace, found ' '
(537,24): run-time error CSS1019: Unexpected token, found ' '
(537,24): run-time error CSS1019: Unexpected token, found ' '
(537,24): run-time error CSS1042: Expected function, found ' '
(537,24): run-time error CSS1062: Expected semicolon or closing curly-brace, found ' '
 */

The corresponding lines in CSS are:

width: -webkit-calc(100% - 0.5em);
width: -moz-calc(100% - 0.5em);
width: -ms-calc(100% - 0.5em);
width: -o-calc(100% - 0.5em);

What can I do for minification to work with css3's calc feature?

解决方案

I'm not sure you'll be able to use it in the current implementation. I think you have two things working against you here.

  1. Per http://www.w3.org/standards/techs/css#w3c_all nearly everything is still a working draft. It probably isn't worth the effort to implement something in System.Web.Optimization if it's going to change, and cause more issues in the long term.

  2. calc() is currently apart of CSS Values and Units Module Level 3 which states:

    The following features are at-risk and may be dropped during the CR period: ‘calc()’, ‘toggle()’, ‘attr()’."

So with those things, Microsoft may not be on the bleeding edge of CSS3. Granted, this is more than likely a bug since that syntax isn't completely off the wall. Hopefully they open source System.Web.Optimization soon so people could fix issues like this. But they've been promising to open source it for nearly a year now.

In the meantime, you could try to prebundle the file locally on your machine where you have a lot of control over it. Or maybe try a different bundling/minification system like Cassette.

这篇关于MVC4捆绑:微小失败,因为CSS3的特征?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆