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: sourcemap sources removes webpack path #1122

Merged
merged 4 commits into from
Oct 18, 2023
Merged

fix: sourcemap sources removes webpack path #1122

merged 4 commits into from
Oct 18, 2023

Conversation

axuj
Copy link
Contributor

@axuj axuj commented Oct 12, 2023

The source is now in the format webpack://[namespace]/[resourcePath]

src/index.js Outdated
if (source.startsWith('webpack/'))
return '/webpack/' + source.slice(8);
return sourceMapBasePrefix + source;
// webpack://[namespace]/[resourcePath]
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this no longer accounts for the webpack:///webpack:/// case.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, look at output.devtoolModuleFilenameTemplate , I think using webpack config is a better choice

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! Is there a way to add a test to confirm this fixes the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure! I've added tests

test/unit/minify update output
test/unit/minify-sourcemap-register
test/unit/minify-v8cache-sourcemap-register
Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

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

Thanks! 🎉

@styfle styfle enabled auto-merge (squash) October 18, 2023 21:00
@styfle styfle merged commit ce5984e into vercel:main Oct 18, 2023
16 checks passed
@github-actions
Copy link

🎉 This PR is included in version 0.38.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Source maps are generated incorrectly and cannot be debugged in vscode. ncc producing faulty source maps?
2 participants