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.

82 lines
2.6 KiB

2 years ago
import { defineConfig, loadEnv } from 'vite';
import createVitePlugins from './vite/plugins';
2 years ago
const { resolve } = require('path');
// https://vitejs.dev/config/
export default ({ mode, command }) => {
const env = loadEnv(mode, process.cwd());
const { VITE_APP_BASE } = env;
return defineConfig({
base: VITE_APP_BASE,
server: {
port: 2888,
proxy: {
'/api': {
1 year ago
// target: 'http://192.168.10.126:8889',
// hy
12 months ago
// target: 'http://192.168.3.12:13000',
3 months ago
// longge
// target: 'http://192.168.3.16:13000',
10 months ago
// xiaohei
4 weeks ago
// target:'http://192.168.3.65:13000' ,
// target: 'http://192.168.3.65:13000',
1 year ago
// lmy
// target: 'http://192.168.10.123:8889',
7 months ago
// cg
3 months ago
// target: 'http://192.168.3.73:13000',
// cg
// target: 'http://192.168.3.2:13000',
1 year ago
// target: 'http://192.168.10.101:8888',
// 老zyc
// target: 'http://192.168.10.75:8777',
1 year ago
// 新zyc
// target: 'http://192.168.6.116:8777',
// target: 'http://192.168.6.122:8777',
4 weeks ago
// target: 'http://192.168.3.14:13000',
// target: 'http://192.168.10.25:2888',
11 months ago
// target: 'http://192.168.6.161:9777',//CY
// target: 'http://192.168.10.57:13000',
// target: 'http://192.168.10.200:13000',
// target: 'http://192.168.3.16:13000',
3 months ago
// target: 'http://192.168.3.73:13000', //
4 weeks ago
// target: 'http://api.huo5u.com/',
target: 'http://test.api.huo5u.com',
2 years ago
changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ''),
},
'/imgapi': {
7 months ago
target: 'http://127.0.0.1:38088',
changeOrigin: true,
rewrite: path => path.replace(/^\/imgapi/, ''),
},
2 years ago
},
},
3 months ago
esbuild:{
drop: ['console','debugger']
},
2 years ago
resolve: {
alias: {
'~': resolve(__dirname, './'),
'@': resolve(__dirname, './src'),
components: resolve(__dirname, './src/components'),
styles: resolve(__dirname, './src/styles'),
utils: resolve(__dirname, './src/utils'),
},
},
plugins: createVitePlugins(env, command === 'build'),
2 years ago
build: {
chunkSizeWarningLimit: 1000,
rollupOptions: {
output: {
// 分包
manualChunks(id) {
if (id.includes('node_modules')) {
return id.toString().split('node_modules/')[1].split('/')[0].toString();
2 years ago
}
},
},
},
},
2 years ago
});
};