| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- import { fileURLToPath, URL } from 'node:url'
- import { defineConfig } from 'vite'
- import vue from '@vitejs/plugin-vue'
- export default defineConfig(({ mode }) => {
- const isProd = mode === 'production'
- return {
- base: '/',
- plugins: [vue()],
- resolve: {
- alias: {
- '@': fileURLToPath(new URL('./src', import.meta.url)),
- },
- },
- server: {
- host: '0.0.0.0',
- port: 7100,
- strictPort: true,
- proxy: {
- '/api': {
- target: process.env.VITE_API_TARGET || 'http://localhost:8080',
- changeOrigin: true,
- },
- },
- },
- build: {
- target: 'es2015',
- sourcemap: false,
- outDir: 'dist',
- assetsDir: 'assets',
- rollupOptions: {
- output: {
- chunkFileNames: 'assets/[name]-[hash].js',
- manualChunks: {
- echarts: ['echarts'],
- vue: ['vue', 'vue-router'],
- },
- },
- },
- },
- }
- })
|