42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
import path from 'path'
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
vue(),
|
|
vueDevTools(),
|
|
createSvgIconsPlugin({
|
|
// Specify the icon folder to be cached
|
|
iconDirs: [path.resolve(process.cwd(), 'src/icons/svg')],
|
|
// Specify symbolId format
|
|
symbolId: 'icon-[dir]-[name]',
|
|
}),
|
|
],
|
|
server: {
|
|
port: 5174,
|
|
host: '0.0.0.0',
|
|
proxy: {
|
|
'/dev-api': {
|
|
target: 'http://localhost:9528', // Assuming Vue 2 backend is running here, user can change
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/dev-api/, '')
|
|
},
|
|
'/dl-api': {
|
|
target: 'http://dl.wms.gztbyc.com',
|
|
changeOrigin: true,
|
|
rewrite: (path) => path.replace(/^\/dl-api/, '')
|
|
}
|
|
}
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
|
},
|
|
},
|
|
})
|