book-web/vite.config.ts
2024-07-16 10:02:54 +08:00

32 lines
711 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { resolve } from 'path'
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
import vueSetupExtend from 'vite-plugin-vue-setup-extend'
// 参考https://cn.vitejs.dev/config/
export default defineConfig({
base: './',
resolve: {
// 配置别名
alias: {
'@': resolve(__dirname, './src'),
'vue-i18n': 'vue-i18n/dist/vue-i18n.cjs.js'
}
},
plugins: [
vue(),
vueSetupExtend(),
createSvgIconsPlugin({
iconDirs: [resolve(__dirname, 'src/icons/svg')],
symbolId: 'icon-[dir]-[name]'
})
],
server: {
host: '0.0.0.0',
port: 3000, // 端口号
open: false // 是否自动打开浏览器
}
})