Skip to content
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

sourceMappingURL #43

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

sourceMappingURL #43

wants to merge 4 commits into from

Conversation

soluml
Copy link

@soluml soluml commented Mar 7, 2014

This option allows you to automatically append the sourceMappingURL comment to the generated JS file. Currently, an option to do this by default in Closure Compiler.

The generated comment will look something like this at the end of the JS file:

//# sourceMappingURL=file.js.map

The sourceMapUrl option can be boolean true if you want to match the generated file's name or you can specify a string and name it whatever you'd like.

soluml added 4 commits March 6, 2014 11:26
Added source map support for this plugin, also added documentation.
Updated to use options object for Source Map generation.
@@ -26,10 +26,12 @@ grunt.initConfig({
closurePath: '/src/to/closure-compiler',
js: 'static/src/frontend.js',
jsOutputFile: 'static/js/frontend.min.js',
sourceMapUrl: true,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't see the point in this option, should just check for options.create_source_map

@evenicoulddoit
Copy link

From a quick look at the issue, I also think it would be nice, after running the compiler, to append the source map URL to the compiled file, if the option has been set. However, an additional issue which I've found, is that the sources key within the map is relative to the working directory (PWD) from which the compiler is run. This messes up the map and you need to tinker with the sources in order to fix. For note, I'm currently using grunt.contrib.watch to automatically compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants