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.
 
 
 
 
hoto-auth-vue3/vite.config.js

41 lines
1.2 KiB

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)),
'@CustomComponents': fileURLToPath(new URL('./src/components/Custom', import.meta.url)),
'@utils': fileURLToPath(new URL('./src/utils', import.meta.url)),
}
},
css:{
devSourcemap: true
},
server:{
host: "0.0.0.0",
proxy: {
[env.VITE_BASE_URL]: {
target: env.VITE_HTTP_PROXY,
changeOrigin: true,
rewrite: (path) => path.replace(new RegExp(env.VITE_BASE_URL) , ''),
}
}
}
};
});