-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Vite: "@charset" must be the first rule in the file #12867
Comments
Hi @Maggie0002! 👋 It looks like you provided an invalid or unsupported reproduction URL. Without a proper reproduction, your issue will have to get closed. Thank you for your collaboration. 👏 |
It looks like this works: https://lifesaver.codes/answer/build-includes-charset-problem-5833 In {
build: {
extendViteConf(viteConf) {
if (viteConf.css !== Object(viteConf.css)) {
viteConf.css = {};
}
if (viteConf.css.postcss !== Object(viteConf.css.postcss)) {
viteConf.css.postcss = {};
}
if (Array.isArray(viteConf.css.postcss.plugins) === false) {
viteConf.css.postcss.plugins = [];
}
viteConf.css.postcss.plugins.unshift({
postcssPlugin: 'internal:charset-removal',
AtRule: {
charset: (atRule) => {
if (atRule.name === 'charset') {
atRule.remove();
}
},
},
});
},
},
}, |
@pdanpdan - Confirmed. This fixes the build warning. Thanks! Scott |
I think there is an upstream fix coming for it too: vitejs/vite#6333 (comment) & vitejs/vite#7678 |
What happened?
When building using Vite, the following message displays:
There is a proposed fix to consider as default: vitejs/vite#6333 (comment)
What did you expect to happen?
No need for these error messages to display.
Reproduction URL
Not applicable
How to reproduce?
Run
quasar build
on a new Quasar project using Vite (I chose Typescript but otherwise default settings).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
No response
Quasar info output
No response
Relevant log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: