Skip to content

respect sourcemapExcludeSources when constructing map #93

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

Merged
merged 5 commits into from
Oct 20, 2020
Merged

respect sourcemapExcludeSources when constructing map #93

merged 5 commits into from
Oct 20, 2020

Conversation

alexdilley
Copy link
Contributor

No description provided.

@antony
Copy link
Member

antony commented Oct 14, 2020

Is there a way to verify this change? It's been submitted without a description/rationale nor any expectation of before and after, or what problem it solves.

@lukeed
Copy link
Member

lukeed commented Oct 19, 2020

Hi @alexdilley – I know it's been a while (sorry!) but can you please check out the current code on master: https://github.com/sveltejs/rollup-plugin-svelte/blob/master/index.js#L338-L339

Instead of pushing null, it now skips the push entirely. I included tests for this, and don't see or know of any reason why null is preferred here.

If you could let me know, we'd appreciate that. Thanks!

@alexdilley
Copy link
Contributor Author

Eek! Sorry I posted such a vague PR!! I'll come back to you with a response and more detail.

@alexdilley
Copy link
Contributor Author

alexdilley commented Oct 19, 2020

One quick follow-up, though... My interpretation of sourcemapExcludeSources is that it produces source maps that don't expose source content, akin to nosources-source-map in Webpack:

nosources-source-map - A SourceMap is created without the sourcesContent in it. It can be used to map stack traces on the client without exposing all of the source code. You can deploy the Source Map file to the webserver.

Do the changes you highlight, @lukeed, suggest that both the source content as well as the source map are omitted?

(btw, great talk yesterday, @lukeed! I'm keen to look into freshie!)

@lukeed
Copy link
Member

lukeed commented Oct 19, 2020

I think you're right! I just checked out Rollup's tests to see how it should be: https://github.com/rollup/rollup/tree/24fe07f39da8e4225f4bc4f797331930d8405ec2/test/form/samples/sourcemaps-excludesources/_expected

Looks like sources is OK to keep its file paths, but it sets sourcesContent: null in the output.

If you want to update this PR to fix that up, I'll get it in asap! Otherwise I can tweak it.

(Thank you 😃)

@lukeed
Copy link
Member

lukeed commented Oct 19, 2020

I made the changes so that we now follow Rollup's lead – probably a good/safe example to follow 😆
Will have to update the tests to match this change. They have the (aka, my*) faulty assumption baked in.

Copy link
Member

@lukeed lukeed left a comment

Choose a reason for hiding this comment

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

Thanks!

@lukeed lukeed merged commit 3efd32e into sveltejs:master Oct 20, 2020
@alexdilley
Copy link
Contributor Author

Awesome! Nice work, @lukeed. Thanks so much for getting this pushed through.

@alexdilley alexdilley deleted the feat-source-maps branch October 20, 2020 11:04
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.

3 participants