You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { join, resolve } from 'node:path'
|
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
import vueJsx from '@vitejs/plugin-vue-jsx'
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
import UnoCSS from 'unocss/vite'
|
|
|
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
|
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
|
|
|
plugins: [
|
|
|
|
vue(),
|
|
|
|
vueJsx(),
|
|
|
|
UnoCSS(),
|
|
|
|
createSvgIconsPlugin({
|
|
|
|
// eslint-disable-next-line node/prefer-global/process
|
|
|
|
iconDirs: [resolve(process.cwd(), 'src/assets/svg')],
|
|
|
|
symbolId: 'icon-[name]',
|
|
|
|
}),
|
|
|
|
],
|
|
|
|
base: './',
|
|
|
|
publicDir: 'public',
|
|
|
|
resolve: {
|
|
|
|
// 配置路径别名
|
|
|
|
alias: {
|
|
|
|
'@': join(__dirname, 'src'),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// 全局 css 注册
|
|
|
|
css: {
|
|
|
|
preprocessorOptions: {
|
|
|
|
scss: {
|
|
|
|
javascriptEnabled: true,
|
|
|
|
additionalData: `@import "src/design/index.scss";`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|