Uh oh!
There was an error while loading. Please reload this page.
fix(vite): allow overriding vite sourcemap - #7342
Conversation
✅ Deploy Preview for nuxt3-docs canceled.
|
pi0
commented
Sep 8, 2022
This might be a breaking change but having multiple sources of trust is probably more dangerous to introduce such cases. Any reason we can't rely on one top level |
danielroe
commented
Sep 8, 2022
I think issue is that vite allows multiple kinds of sourcemaps. e.g. 'hidden' or 'inline'. |
pi0
commented
Sep 8, 2022
I see. It is same for webpack too actually. I was going to suggest in initial refactor to extend boolean to other string values per type. But in this case, for now it can be enabled with top level sourcemap.client (it is a breaking change) and keep using vite config until we can do that. I don't think implicitly auto enabling client sourcemap was right behavior. |
danielroe
commented
Sep 8, 2022
I'm not sure I understand what you are suggesting. What do you mean by "implicitly auto enabling client sourcemap"? What are you saying the problem is with the previous PR? |
pi0
commented
Sep 8, 2022
No i mean changes with previous PR was right (we just forgot to mark it as breaking change). Before PR, setting |
| }, | ||
| build: { | ||
| sourcemap: ctx.nuxt.options.sourcemap.client, | ||
| sourcemap: ctx.config.build?.sourcemap ?? ctx.nuxt.options.sourcemap.client, |
There was a problem hiding this comment.
This could be reversed. options.sourcemap.client? config.build.sourcemap : false this way we both respect enabling flags and vite configuration for type.
🔗 Linked issue
resolvesnuxt/nuxt#14840
❓ Type of change
📚 Description
Since we started setting sourcemap per-client, per-server, we are overriding the user's choice if they have configured this manually, which they may wish to do.
This respects the value of
vite.build.sourcemapif set.📝 Checklist