Open dongwa opened 2 years ago
Relevant line at https://github.com/quasarframework/quasar/blob/56c819d1f32ef191387626f1d5c33485e5dbc04d/app-vite/lib/config-tools.js#L120
The relevant Vite documentation is at https://vitejs.dev/config/build-options.html#build-sourcemap and Quasar is just reflecting the Vite documentation
Sooo.... it seems that Quasar is neither doing what its own docs say nor the Vite docs and is defaulting to "inline" when the config is true. Moreover, there seems to be no possible way of actually passing true
through to Vite and therefore no way of generating separate sourcemap file.
Suggested code fix would simply be
sourcemap: build.sourcemap ?? false
For those that are looking for a quick workaround, one can fortunately do
sourcemap: 'true'
By setting it to a string, the quasar code passes it through (due to use of ===) but the vite code will respect the truthiness
Relevant line at
The relevant Vite documentation is at https://vitejs.dev/config/build-options.html#build-sourcemap and Quasar is just reflecting the Vite documentation
Sooo.... it seems that Quasar is neither doing what its own docs say nor the Vite docs and is defaulting to "inline" when the config is true. Moreover, there seems to be no possible way of actually passing
true
through to Vite and therefore no way of generating separate sourcemap file.Suggested code fix would simply be
sourcemap: build.sourcemap ?? false
You can pr it😊
Relevant line at https://github.com/quasarframework/quasar/blob/56c819d1f32ef191387626f1d5c33485e5dbc04d/app-vite/lib/config-tools.js#L120
The relevant Vite documentation is at https://vitejs.dev/config/build-options.html#build-sourcemap and Quasar is just reflecting the Vite documentation Sooo.... it seems that Quasar is neither doing what its own docs say nor the Vite docs and is defaulting to "inline" when the config is true. Moreover, there seems to be no possible way of actually passing
true
through to Vite and therefore no way of generating separate sourcemap file. Suggested code fix would simply besourcemap: build.sourcemap ?? false
You can pr it😊
Happy to do so
This issue is the same as issue #14946, which also has a similar fix #14109
What happened?
I want to test the configuration item of SourceMap. I found that when I set quasar.config.js > build > sourcemap to
true
, there was no separate sourcemap file in the dist/spa folder as described in the document:What did you expect to happen?
I don't know whether this is a document description error or quasar CLI behavior mistake, I think they should be consistent
Reproduction URL
https://stackblitz.com/edit/quasarframework-bdqfmg?file=dist/spa/assets/ErrorNotFound.ff16392e.js
How to reproduce?
Flavour
Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)
Areas
Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite)
Platforms/Browsers
Chrome, Microsoft Edge
Quasar info output
Relevant log output
No response
Additional context
No response