Skip to content

fix: sourcemap sources removes webpack path#1122

Merged
styfle merged 4 commits intovercel:mainfrom
axuj:main
Oct 18, 2023
Merged

fix: sourcemap sources removes webpack path#1122
styfle merged 4 commits intovercel:mainfrom
axuj:main

Conversation

@axuj
Copy link
Copy Markdown
Contributor

@axuj axuj commented Oct 12, 2023

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

@axuj axuj requested review from Timer and styfle as code owners October 12, 2023 13:08
Comment thread src/index.js Outdated
if (source.startsWith('webpack/'))
return '/webpack/' + source.slice(8);
return sourceMapBasePrefix + source;
// webpack://[namespace]/[resourcePath]
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
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

axuj added 3 commits October 13, 2023 15:29
test/unit/minify update output
test/unit/minify-sourcemap-register
test/unit/minify-v8cache-sourcemap-register
Copy link
Copy Markdown
Contributor

@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
@github-actions
Copy link
Copy Markdown

🎉 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