Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h2>The minification "works" even if that errors appears</h2> <p>The real solution for this is:</p> <ul> <li>Exclude .min and .map files <strong>BEFORE</strong> you publish</li> </ul> <p>And the minification will work. In fact, the minification process always works!</p> <h2>If "it works", what is it really going on: why do we have an error?</h2> <p>ASP.Net seems to use .min files in priority when bundling with enabled optimizations. So it will also integrate any code in .min files and append every javascript file one after another without adding line breaks.</p> <p>It is <strong>the browser</strong> that cannot understand why there is a potential comment /* After the min mapping configuration: //# sourceMappingURL=jquery.history.min.js.map Because bundled files will look like:</p> <pre><code>[SOMEJAVASCRIPT OF FILEJAVASCRIPT1 HERE;] //# sourceMappingURL=jquery.history.min.js.map /* begin of a comment of FILEJAVASCRIPT2 appended (in the bundle) javascript file */ </code></pre> <p>There are two solutions to avoid that error:</p> <ul> <li>Create separate bundles for the javascript files that can't follow (it's like not activating the bundling feature).</li> <li>Create a bundle that will not enable minification (bad)</li> <li>Or an alternative: exlude all minified files or the min.js files that have a sourceMappingURL (or change their source) and .map files</li> </ul> <p>The goal would be to force ASP.Net to regenerate min files by itself (and ASP.Net will not make //sourceMappingUrl inside its generated file so it will fix that problem).</p> <p>So the real problem is the current implementation of this feature inside the browsers because it cannot seem to parse comments for the comment of sourcemapping. Maybe there's another way to indicate the browser that the sourceMappingUrl has ended.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload