智慧物流-晋恒通-横屏
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.
 
 
 
 

33 lines
1.0 KiB

import * as path from 'path'
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import pkg from './package.json'
import { createProxy } from './build/proxy';
export default ({ mode }) => {
const { VITE_PROXY } = loadEnv(mode, process.cwd());
console.log("🚀 ~ file: vite.config.ts ~ line 8 ~ VITE_PROXY", createProxy(JSON.parse(VITE_PROXY)))
return defineConfig({
plugins: [vue()],
server: {
open: true,
proxy: createProxy(JSON.parse(VITE_PROXY)),
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
comp: path.resolve(__dirname, './src/components'),
views: path.resolve(__dirname, './src/views'),
api: path.resolve(__dirname, './src/api'),
utils: path.resolve(__dirname, './src/utils'),
assets: path.resolve(__dirname, './src/assets'),
store: path.resolve(__dirname, './src/store'),
router: path.resolve(__dirname, './src/router'),
},
},
define: {
_APP_VERSION: JSON.stringify(pkg.version),
},
})
}