From:  James Burke <jrburke@gmail.com>
Date:  15 Oct 2013 03:46:01 Hong Kong Time
Newsgroup:  news.mozilla.org/mozilla.dev.js-sourcemap
Subject:  

Source map for minified bundle target

NNTP-Posting-Host:  24.86.26.209

(Apologies if this is a duplicate post, first post returned a mail delivery subsystem error):

I work on RequireJS, and its optimizer has some level of support for source maps[1]. I got an error report about the main optimization target, a main.js, that is a result of bundling multiple scripts together then minifying, does not have its own unminified entry in browser developer tools[2].

I created an example, and was wondering how best to fix the issue, or if it is just a browser bug. 

What I see now is Firefox Nightly shows the original source of main.js as I would expect, where Chrome Canary shows the minified content. However, generally, I cannot seem to set and keep breakpoints in Firefox Nightly. So I suspect I am doing something wrong.

In general, I use this tool to verify the contents of a .js and its .map file:
http://sokra.github.io/source-map-visualization/#custom

Test case is up here:
http://requirejs.org/bugs/main-sourcemap/

Zip file of the test:
http://requirejs.org/bugs/main-sourcemap.zip

The source map is a combination of two source map steps:

single file JS files -> bundled JS file -> uglifyjs minification.

So, main.js is a module that requires an 'a' and 'b' modules, that get combined with the 'main' module, then that result is minified.

I am using the "sourcesContent" approach to keep the sources around through the different transforms.

Thanks for any insights,

James

[1] http://requirejs.org/docs/optimization.html#sourcemaps
[2] https://github.com/jrburke/r.js/issues/524