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

Concatenating multiple files with sourcemaps #155

Closed
leigeber opened this issue Mar 31, 2016 · 2 comments · Fixed by #156
Closed

Concatenating multiple files with sourcemaps #155

leigeber opened this issue Mar 31, 2016 · 2 comments · Fixed by #156

Comments

@leigeber
Copy link
Contributor

When joining two files that were previously minified with sourcemaps everything almost works perfectly but the trailing sourcemap declarations from the sources, for instance //# sourceMappingURL=maps/script.js.map ends up becoming just // on its own line which throws off the sourcemapping for any files after the first concatenated file.

If I remove the blank comment lines from the output everything seems to click. Is there a reason for not removing the entire sourcemap comment?

Here is the input for instance.

JavaScript 1
//# sourceMappingURL=maps/one.js.map
JavaScript 2
//# sourceMappingURL=maps/two.js.map

Here is what concat is doing.

JavaScript 1
//
JavaScript 2
//
//# sourceMappingURL=maps/script.js.map

Here is what works.

JavaScript 1
JavaScript 2
//# sourceMappingURL=maps/script.js.map
@BrianLenzo
Copy link

+1 I just ran across the same issue. I was concatenating multiple CSS files that were already minified and it successfully removed the source map reference but left the "/* */" which threw off the rest of the source maps.

I thought stripBanners would take care of this, but it doesn't. This bug has always existed as far as I can tell. I tried with 1.0 and 0.5.1 and 0.5.0.

@hsingh23
Copy link

@leigeber I think I'm having a similar concat problem, breakpoints don't work on the last js file I concat (or maybe more), I tried the proposed fix and didn't have much luck with that as well. I'm still investigating.

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 a pull request may close this issue.

3 participants