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.
36 lines
960 B
36 lines
960 B
3 months ago
|
import { fileURLToPath, URL } from 'node:url';
|
||
|
|
||
|
import { defineConfig, loadEnv } from 'vite';
|
||
|
import vue from '@vitejs/plugin-vue';
|
||
|
import vueJsx from '@vitejs/plugin-vue-jsx';
|
||
|
import vueDevTools from 'vite-plugin-vue-devtools';
|
||
|
|
||
|
// https://vitejs.dev/config/
|
||
|
export default defineConfig(({ command, mode }) => {
|
||
|
|
||
|
// eslint-disable-next-line no-undef
|
||
|
const env = loadEnv(mode, process.cwd(), '');
|
||
|
|
||
|
return {
|
||
|
plugins: [
|
||
|
vue(),
|
||
|
vueJsx(),
|
||
|
vueDevTools(),
|
||
|
],
|
||
|
resolve: {
|
||
|
alias: {
|
||
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||
|
}
|
||
|
},
|
||
|
server:{
|
||
|
proxy: {
|
||
|
[env.VITE_BASE_URL]: {
|
||
|
target: env.VITE_HTTP_PROXY,
|
||
|
changeOrigin: true,
|
||
|
rewrite: (path) => path.replace(new RegExp(env.VITE_BASE_URL) , ''),
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
});
|