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

external sourcemaps #307

Closed
tnguyen14 opened this issue Mar 18, 2015 · 7 comments
Closed

external sourcemaps #307

tnguyen14 opened this issue Mar 18, 2015 · 7 comments

Comments

@tnguyen14
Copy link

Is there a way to generate external sourcemaps with this plugin?

@tleunen
Copy link
Collaborator

tleunen commented Mar 19, 2015

Nop, but you can use Exorcist to externalize the inlined sourcemap from the bundle.

@tnguyen14
Copy link
Author

I was able to extract it using grunt-external-sourcemap, but unfortunately it doesn't work when watch: true.

@tleunen
Copy link
Collaborator

tleunen commented Mar 23, 2015

Running exorcist in the postBundleCB should work.. Did you try that?

@tnguyen14
Copy link
Author

@tleunen do you have an example of how that config would look like?

@tleunen
Copy link
Collaborator

tleunen commented Mar 23, 2015

Hmm, the problem is that inside postBundleCB, the destination file is not created yet.
But what you can do is, based on the string buffer, get the inlined sourcemap, replace it by the reference to another file, and write the sourcemap inside another file.

If there were a hook to run something when the bundle is complete, you could run grunt-external-sourcemap but unfortunately, it's not the case.

Why would you like to get the sourcemap in another file while using watch: true?

@tnguyen14
Copy link
Author

Yeah that's a great question. I personally wouldn't mind if it's inline. However, in the office, we use Eclipse as the company standard IDE and it tends to crash when trying to open a compiled JS file with inline sourcemaps.

@tleunen
Copy link
Collaborator

tleunen commented Mar 31, 2015

I think your best bet is to let the sourcemap inside the bundle, and then run another task to extract the sourcemap from the bundle.

So try to use grunt-contrib-watch to watch your bundle file, and as soon as the file changed, run grunt-external-sourcemap to extract it.

@tleunen tleunen closed this as completed Mar 31, 2015
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

No branches or pull requests

2 participants