-
Notifications
You must be signed in to change notification settings - Fork 521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add sourceMap support to stealjs builds #103
Comments
Anyone has an idea on how to potentially solve this?? I'd also be willing to submit a pull request if you guide me on how to best accomplish sourceMap support from your point of view. |
The issue is minification of multiple files is handled by steal and not left to be handled by the minification. js.makePackage is what combines several files then calls minify on it: https://github.com/bitovi/steal/blob/master/build/js/js.js#L137 Maybe we could somehow tell if source maps are supported by the minifier and allow the minifier to do it's magic. |
In fact, that's what I noticed on my first attempt to implement this.
So basically you are saying that we should somehow tell steal to not call the js.makePackage and directly pass all of the source files one after the other to the minifier for making the concatenation and adding of the sourceMap support. That was my idea as well, I just didn't know whether to skip the steal package bundling could have some other side effects. |
Not exactly. makePackage still should be called. It makes the package after all. makePackage should work with js.minify (and js.minify with closure) to make sure sourceMap works. For example, js.minify could take an array of sources. The problem is that we need to add steal.executed to our files to make sure steal works with them correctly. I'd have to investigate how to make this work with google closure. |
I moved this here: stealjs/steal-tools#37. Thanks! |
Hi,
it would be amazing if you guys could add support for sourceMaps in steal builds.
That's quite handy when you have to debug minimized JS files in production environments (for instance).
My insights so far
Seems like it should be integrated somewhere in the command arguments of the closure compiler in jsminify.js. Normally Google's closure compiler accepts a series of JavaScript files using multiple
--js
params. By then giving it the params--create_source_map
and--source_map_format=V3
it'll generate an according sourcemap file which needs to be referenced in the minified file by "manually" appendingAs far as I understood, the current implementation of steal's build script executes a build and compression of each single JS file individually which are then appended together to the final
production.js
file. Hence I was not sure how to integrate support for sourcemaps as that would mean to merge them as well..The text was updated successfully, but these errors were encountered: