Skip to content

feat(vite): add node_modules and buildDir to x_google_ignoreList#19243

Merged
danielroe merged 1 commit into
mainfrom
feat/ignore-nm-stack
Mar 2, 2023
Merged

feat(vite): add node_modules and buildDir to x_google_ignoreList#19243
danielroe merged 1 commit into
mainfrom
feat/ignore-nm-stack

Conversation

@danielroe

@danielroe danielroe commented Feb 23, 2023

Copy link
Copy Markdown
Member

🔗 Linked issue

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Rollup now supports (rollup/rollup#4848) adding certain files to the x_google_ignoreList source map extension. We can opt-in to this to provide a better default experience on Chrome.

Before After
CleanShot 2023-02-23 at 15 17 10@2x CleanShot 2023-02-23 at 15 16 18@2x

Limitations: This is a specific enhancement only for vite. More significantly, at the moment this is only processed in the rollup/vite production build rather than in development, which is a bit of a pain. I've marked this as draft to investigate further. It might require an upstream vite enhancement. This will need to be enabled upstream in vite first before being configurable here.

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added ✨ enhancement New feature or improvement to existing functionality bundler:vite Vite bundler integration labels Feb 23, 2023
@danielroe danielroe self-assigned this Feb 23, 2023
@codesandbox

codesandbox Bot commented Feb 23, 2023

Copy link
Copy Markdown

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@bmeurer

bmeurer commented Feb 23, 2023

Copy link
Copy Markdown

Nice! I just captured this in our tracking doc. 👍

@danielroe danielroe marked this pull request as ready for review February 23, 2023 21:27
@danielroe danielroe added 3.x 🍰 p2-nice-to-have Nice to have, not blocking labels Feb 23, 2023
@danielroe danielroe merged commit 21e3e17 into main Mar 2, 2023
@danielroe danielroe deleted the feat/ignore-nm-stack branch March 2, 2023 15:28
Comment thread packages/vite/src/vite.ts
rollupOptions: {
output: {
sourcemapIgnoreList: (relativeSourcePath) => {
return relativeSourcePath.includes('/node_modules/') || relativeSourcePath.includes(ctx.nuxt.options.buildDir)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Does this work on Windows? For rollup I had to change it to relativeSourcePath.includes('node_modules') to make the test pass on the Windows bot.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

updated in 73ade18

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

Labels

3.x bundler:vite Vite bundler integration ✨ enhancement New feature or improvement to existing functionality 🍰 p2-nice-to-have Nice to have, not blocking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants