48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
import {defineConfig} from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import path from "path";
|
|
import {createSvgIconsPlugin} from 'vite-plugin-svg-icons'
|
|
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
envDir:"env",
|
|
envPrefix:["VITE_","_"],
|
|
server: {
|
|
host: "127.0.0.1",
|
|
port: 3000,
|
|
strictPort: true,
|
|
},
|
|
plugins: [
|
|
vue(),
|
|
createSvgIconsPlugin({
|
|
// 指定需要缓存的图标文件夹
|
|
iconDirs: [path.resolve(process.cwd(), './src/assets/icon')],
|
|
// 指定symbolId格式
|
|
symbolId: '[name]',
|
|
|
|
/**
|
|
* 自定义插入位置
|
|
* @default: body-last
|
|
*/
|
|
// inject?: 'body-last' | 'body-first'
|
|
|
|
/**
|
|
* custom dom id
|
|
* @default: __svg__icons__dom__
|
|
*/
|
|
customDomId: '__svg__icons__dom__',
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
'@': path.resolve(__dirname, './src'),
|
|
'@a': path.resolve(__dirname, './src/assets'),
|
|
'@v': path.resolve(__dirname, './src/views'),
|
|
}
|
|
},
|
|
build: {
|
|
target: ['edge90', 'chrome90', 'firefox90', 'safari15']
|
|
}
|
|
})
|