build 正常使用

This commit is contained in:
吕金泽
2022-03-20 00:31:05 +08:00
parent d007875a43
commit 4bcd0cfc3b
6 changed files with 64 additions and 71 deletions
+28 -11
View File
@@ -5,17 +5,34 @@ import viteSvgIcons from 'vite-plugin-svg-icons'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
viteSvgIcons({
iconDirs: [path.resolve(process.cwd(), 'src/icons')],
symbolId: 'mb-icon-[name]'
})
],
resolve: {
base: './',
plugins: [
vue(),
viteSvgIcons({
iconDirs: [path.resolve(process.cwd(), 'src/icons')],
symbolId: 'mb-icon-[name]'
})
],
resolve: {
extensions: ['.vue', '.json', '.js'],
alias: {
'@': path.resolve(__dirname,'src')
alias: {
'@': path.resolve(__dirname,'src')
}
},
css: {//去除@charset UTF-8规则影响
postcss: {
plugins: [
{
postcssPlugin: 'internal:charset-removal',
AtRule: {
charset: (atRule) => {
if (atRule.name === 'charset') {
atRule.remove();
}
}
}
}
]
}
}
}
})