You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.2 KiB
JavaScript

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
export default defineConfig({
plugins: [
vue(),
createSvgIconsPlugin({
// 指定 SVG 文件目录(递归扫描)
iconDirs: [resolve(__dirname, 'src/assets/image')],
// symbol id 格式icon-文件夹-文件名
symbolId: 'icon-[dir]-[name]',
// 注入位置
inject: 'body-last',
customDomId: '__svg_sprite__',
}),
],
base: "./",
server: {
port: '55813', // 指定启动端口
open: true, //启动后是否自动打开浏览器
proxy: {
'/api': {
// target: 'https://kcsl-dev.kangcer.com',
// target: 'http://localhost:53801',
// target: 'http://localhost:10640',
target: 'http://localhost:5276',
secure: false,
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, '')
}
}
},
resolve: {
// 配置别名 添加的,这里只添加了一个别名,想配置更多别名就在这里再加条目即可
alias: {
'@': resolve(__dirname, './src'),
}
},
})