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.
58 lines
1.3 KiB
58 lines
1.3 KiB
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import path from 'path'
|
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
|
|
|
const baseUrl = {
|
|
development: './',
|
|
beta: './',
|
|
release: './'
|
|
}
|
|
|
|
// https://vitejs.dev/config/
|
|
export default ({ mode }) => defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
createSvgIconsPlugin({
|
|
// 指定需要缓存的图标文件夹
|
|
iconDirs: [path.resolve(process.cwd(), 'src/assets/img/icons')],
|
|
// 指定symbolId格式
|
|
symbolId: 'icon-[name]',
|
|
}),
|
|
],
|
|
base:'./',
|
|
build: {
|
|
minify: 'terser',
|
|
terserOptions: {
|
|
compress: {
|
|
// 生产环境打包移除console
|
|
drop_console: true,
|
|
drop_debugger: true,
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'~': path.resolve(__dirname, './'),
|
|
'@': path.resolve(__dirname, 'src'),
|
|
'@assets': path.resolve(__dirname, 'src/assets'),
|
|
}
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
less: {
|
|
additionalData: '@import "./src/assets/style/global.less";'
|
|
}
|
|
}
|
|
},
|
|
server: {
|
|
port: 8089,
|
|
proxy: {
|
|
'/frontDemoApi': {
|
|
target: 'http://192.168.99.67:8080',
|
|
changeOrigin: true,
|
|
rewrite: path => path.replace(/^\/frontDemoApi/, '')
|
|
}
|
|
}
|
|
}
|
|
})
|