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

Source Maps #234

Open
chrisjohnson opened this issue Feb 23, 2015 · 9 comments
Open

Source Maps #234

chrisjohnson opened this issue Feb 23, 2015 · 9 comments

Comments

@chrisjohnson
Copy link

I can see people have touched on this in the past but I don't see any official requests for this feature. I would love to see it. I am looking at the ClosureJs filter and I can see it would be pretty easy to pass source map variables to the compiler, and I can't imagine it's very hard for the other ones. But I can't do it at the filter level because by then everything has already been aggregated and the original files are lost.

Maybe some sort of way to specify a filter that runs before the aggregation step, or maybe some way for individual filters (like ClosureJs) to disable the aggregation step and perform that themselves? I'm not sure the best way to go about it.

@markstory
Copy link
Owner

There is also a pre-preprocess step that has access to each of the input files for a build target. I don't think that gets any closer to having working source map builds though. Source maps create some additional trickiness as the filter system was designed so that build targets would generate a single file, not multiple files. There are other complications around write access to the output directories and development modes that make source maps tricky. I'm not sure I have a simple answer/solution to these problems though.

@annuh
Copy link

annuh commented Jul 7, 2015

Hi,

I have created the following filter to create source maps using UglifyJS, maybe you can use this?

https://gist.github.com/annuh/679d705ede272448b703

If you'd like I can create a pull request to include this filter?

@markstory
Copy link
Owner

Looks like a good start @annuh. If the source map options were filter config options it could be merged.

@Laykou
Copy link

Laykou commented Dec 25, 2015

👍 I am using Rollbar for production monitoring and it would be nice if there would be be an official way to generate a sourcemap - even with some limitations, even if it would work only with JShrinkFilter and not with UglifyJS or if the source maps would work only if there is no javascript filter. That would be pretty good and useful start too. Thanks alot!

Ref: https://rollbar.com/docs/source-maps/

@jonathan-neugber
Copy link

I am guessing since this Issue is still open Source Maps are not yet supported?

@markstory
Copy link
Owner

@jonathan-neugber That is correct.

@chrisjohnson
Copy link
Author

@markstory what do you think about a definition of common configuration parameters for filters which specify sourcemap options, and then each filter can choose to use or not use those configurations (like @annuh's UglifyJs up there) to output a sourcemap? Just trying to think of a way we can at least allow for people to work support in bit by bit, if we can't get global support working easily. The downside to this approach is that unsupported plugins will silently not spit out sourcemaps but at least it's something.

@markstory
Copy link
Owner

@chrisjohnson I think enabling source maps through a commonly named option that is implemented where possible is a very reasonable idea.

@dereuromark
Copy link
Contributor

I have seen #230 and this one
And I am also a bit annoyed about the warnings in prod env.
I wonder if we could also just add a processor that filters out those for prod? Or even dev, if one doesn't want/need them.

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

No branches or pull requests

6 participants