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

Fix rollup warning about sourcemaps from inject-export-order-plugin #117

Merged
merged 1 commit into from
Oct 22, 2021

Conversation

IanVS
Copy link
Member

@IanVS IanVS commented Oct 18, 2021

When building storybook with this builder, I get many warnings like:

Sourcemap is likely to be incorrect: a plugin (storybook-vite-inject-export-order-plugin) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help

This PR returns map: null, which the rollup documentation says:

If the transformation does not move code, you can preserve existing sourcemaps by returning null:

I think this is okay to do, because this transform only adds code to the end, and there's nothing in the original to map it back to, so it should be fine to leave the existing sourcemaps how they are, I think.

I've tested out this change in my own app by changing the node_modules, and the warnings are no longer shown.

@IanVS IanVS requested a review from eirslett October 18, 2021 17:50
@eirslett
Copy link
Collaborator

Great work finding this workaround/fix! Looks good!

@eirslett eirslett merged commit 2a275f5 into main Oct 22, 2021
@eirslett eirslett deleted the avoid-srcmap-warning branch October 22, 2021 12:36
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