magic-boot/magic-boot-ui/vite.config.js

39 lines
1021 B
JavaScript
Raw Normal View History

2022-03-05 10:42:10 +08:00
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import path from 'path'
import viteSvgIcons from 'vite-plugin-svg-icons'
// https://vitejs.dev/config/
export default defineConfig({
2022-03-20 00:31:05 +08:00
base: './',
plugins: [
vue(),
viteSvgIcons({
iconDirs: [path.resolve(process.cwd(), 'src/icons')],
symbolId: 'mb-icon-[name]'
})
],
resolve: {
2022-03-05 10:42:10 +08:00
extensions: ['.vue', '.json', '.js'],
2022-03-20 00:31:05 +08:00
alias: {
'@': path.resolve(__dirname,'src')
}
},
css: {//去除@charset UTF-8规则影响
postcss: {
plugins: [
{
postcssPlugin: 'internal:charset-removal',
AtRule: {
charset: (atRule) => {
if (atRule.name === 'charset') {
atRule.remove();
}
}
}
}
]
}
2022-03-05 10:42:10 +08:00
}
})