admin管理员组文章数量:1420907
In development bundling works as expected with unbined and unminified files but after deploying a site with web.config set enable the bundles
<pilation debug="false" targetFramework="4.5" />
the result of get a request to a bundle may include a ment at the top similar to the following
/* Minification failed. Returning unminified contents.
.. errors like JS1002 or JSxxxx errors
In other cases no errors are thrown from minification but some javascripts fails to run or errors during execution.
What syntax in otherwise working javascript might cause this behavior after bundling?
In development bundling works as expected with unbined and unminified files but after deploying a site with web.config set enable the bundles
<pilation debug="false" targetFramework="4.5" />
the result of get a request to a bundle may include a ment at the top similar to the following
/* Minification failed. Returning unminified contents.
.. errors like JS1002 or JSxxxx errors
In other cases no errors are thrown from minification but some javascripts fails to run or errors during execution.
What syntax in otherwise working javascript might cause this behavior after bundling?
Share Improve this question asked Jan 8, 2013 at 21:01 Keith LawrenceKeith Lawrence 6414 silver badges11 bronze badges1 Answer
Reset to default 8One situation that can cause this is a single line ment // as the last line of a javascript file. This will cause the next file appened to have at least the first line also mented out
if forexample you have a bundle
bundles.Add(New ScriptBundle("~/bundles/test").Include(
"~/Scripts/adder.js",
"~/Scripts/printer.js"))
adder.js
function adder(a, b) {
return a + b;
}
//this is the adder.js
printer.js
printer = true;
if (printer) {
alert("It works");
document.getElementById("itWorked").textContent = "It worked";
}
本文标签: javascriptASPNET bundle does not work when deployed (debugquotfalsequot)Stack Overflow
版权声明:本文标题:javascript - ASP.NET bundle does not work when deployed (debug="false") - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745346397a2654500.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论