Update vite.config.js

增加新的组件后,vite打包报错@charset,需要增加配置
This commit is contained in:
java2sap
2021-12-31 13:33:50 +08:00
committed by GitHub
parent 1f59cedbb0
commit ac03526ea5

View File

@ -32,5 +32,22 @@ export default defineConfig(({ mode, command }) => {
}
},
},
//fix:error:stdin>:7356:1: warning: "@charset" must be the first rule in the file
css: {
postcss: {
plugins: [
{
postcssPlugin: 'internal:charset-removal',
AtRule: {
charset: (atRule) => {
if (atRule.name === 'charset') {
atRule.remove();
}
}
}
}
],
},
},
}
})