Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

feat(vite, webpack): allow client-side sourcemaps in production - #7313

Merged
pi0 merged 10 commits into
mainfrom
fix/public-sourcemaps
Sep 7, 2022
Merged

feat(vite, webpack): allow client-side sourcemaps in production#7313
pi0 merged 10 commits into
mainfrom
fix/public-sourcemaps

Conversation

@danielroe

@danielroedanielroe commented Sep 7, 2022

Copy link
Copy Markdown
Member

🔗 Linked issue

resolvesnuxt/nuxt#14823

❓ 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

This PR bundles a couple of changes to sourcemap handling:

  1. fixes a bug where nitro sourcemaps were not respecting sourcemap config (a typo)
  2. generates client-side sourcemaps for webpack/vite in production if sourcemap is set to true (or allows either falling back to previous behaviour with new option 'server' or generating only client-side sourcemaps with 'client')
  3. defaults to previous behaviour (generates all sourcemaps in dev, and only server-side sourcemaps in production)
  4. fixes (unrelated) issue with perf(nuxt): tree-shake client-only components from ssr bundle #5750 where client-only components were being tree-shaken out of client build as well 🙈

📝 Checklist

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

@danielroedanielroe added bug Something isn't working nitro vite webpack 🍰 p2-nice-to-have Priority 2: nothing is broken but it's worth addressing labels Sep 7, 2022
@danielroe
danielroe requested a review from pi0September 7, 2022 09:47
@danielroedanielroe self-assigned this Sep 7, 2022
@netlify

netlifyBot commented Sep 7, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs ready!

NameLink
🔨 Latest commit71f48fb
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/63188050ad56d50008f53597
😎 Deploy Previewhttps://deploy-preview-7313--nuxt3-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

Comment threadpackages/schema/src/config/build.ts Outdated
@danielroe
danielroe requested a review from pi0September 7, 2022 11:12
Comment threadpackages/vite/src/server.ts Outdated
Comment threadpackages/nuxt/src/imports/module.ts Outdated
pi0
pi0 approved these changes Sep 7, 2022

@pi0pi0 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. refactor note: i was thinking false | { client, server } from resolved options is more convenient but we can do it later if there are more client || server conditions needed to enable sourcemap for plugins...

@pi0
pi0 merged commit eab4706 into mainSep 7, 2022
@pi0
pi0 deleted the fix/public-sourcemaps branch September 7, 2022 11:32
This was referenced Sep 9, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xbugSomething isn't workingnitro🍰 p2-nice-to-havePriority 2: nothing is broken but it's worth addressingvitewebpack

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nuxt generate won't output javascript source maps

2 participants

@danielroe@pi0