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.
GCSGUI/vite.config.ts

42 lines
1018 B
TypeScript

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
import path from 'path'
import legacy from '@vitejs/plugin-legacy'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
legacy({
targets: ['defaults', 'not IE 11']
}),
vue(),
createSvgIconsPlugin({
// Specify the icon folder to be cached
iconDirs: [path.resolve(process.cwd(), 'src/assets/icons')],
// Specify symbolId format
symbolId: 'icon-[dir]-[name]',
}),
],
base: './',
build:{
target: ['es2015', 'chrome63'],
},
resolve: {
alias: {
'@': path.resolve('./src'), // 相对路径别名配置,使用 @ 代替 src
},
},
server: {
proxy: {
'/onlinetest': {
target: 'http://123.57.54.1:8048/',
changeOrigin: true,
rewrite: path => path.replace(/^\/onlinetest/,'')
}
},
cors: true
},
assetsInclude: ["**/*.gltf", "**/*.glb"],
})