fix(config): 更新环境配置和API代理地址
parent
72df46b096
commit
1ff50c6089
@ -1,67 +1,67 @@
|
|||||||
import path from 'path';
|
import path from 'path';
|
||||||
import TerserPlugin from 'terser-webpack-plugin';
|
import TerserPlugin from 'terser-webpack-plugin';
|
||||||
import { defineConfig } from 'umi';
|
import {defineConfig} from 'umi';
|
||||||
import { appName } from './src/conf.json';
|
import {appName} from './src/conf.json';
|
||||||
import routes from './src/routes';
|
import routes from './src/routes';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
title: appName,
|
title: appName,
|
||||||
outputPath: 'dist',
|
outputPath: 'dist',
|
||||||
alias: { '@parent': path.resolve(__dirname, '../') },
|
alias: {'@parent': path.resolve(__dirname, '../')},
|
||||||
npmClient: 'npm',
|
npmClient: 'npm',
|
||||||
base: '/flowapp/',
|
base: '/flowapp/',
|
||||||
publicPath: '/flowapp/',
|
publicPath: '/flowapp/',
|
||||||
runtimePublicPath: false,
|
runtimePublicPath: false,
|
||||||
mfsu: false,
|
mfsu: false,
|
||||||
routes,
|
routes,
|
||||||
esbuildMinifyIIFE: true,
|
esbuildMinifyIIFE: true,
|
||||||
icons: {},
|
icons: {},
|
||||||
hash: true, // 生产环境开启 hash
|
hash: true, // 生产环境开启 hash
|
||||||
favicons: ['/flowapp/flow-app.png'],
|
favicons: ['/flowapp/flow-app.png'],
|
||||||
headScripts: [{ src: '/flowapp/iconfont.js', defer: true }],
|
headScripts: [{src: '/flowapp/iconfont.js', defer: true}],
|
||||||
clickToComponent: {},
|
clickToComponent: {},
|
||||||
history: {
|
history: {
|
||||||
type: 'browser',
|
type: 'browser',
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
'@react-dev-inspector/umi4-plugin',
|
|
||||||
'@umijs/plugins/dist/tailwindcss',
|
|
||||||
],
|
|
||||||
jsMinifier: 'terser',
|
|
||||||
jsMinifierOptions: {
|
|
||||||
compress: {
|
|
||||||
drop_console: true,
|
|
||||||
drop_debugger: true,
|
|
||||||
},
|
},
|
||||||
},
|
plugins: [
|
||||||
lessLoader: {
|
'@react-dev-inspector/umi4-plugin',
|
||||||
modifyVars: {
|
'@umijs/plugins/dist/tailwindcss',
|
||||||
hack: `true; @import "~@/less/index.less";`,
|
],
|
||||||
|
jsMinifier: 'terser',
|
||||||
|
jsMinifierOptions: {
|
||||||
|
compress: {
|
||||||
|
drop_console: true,
|
||||||
|
drop_debugger: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
lessLoader: {
|
||||||
devtool: process.env.NODE_ENV === 'production' ? false : 'source-map',
|
modifyVars: {
|
||||||
copy: [
|
hack: `true; @import "~@/less/index.less";`,
|
||||||
{ from: 'src/conf.json', to: 'dist/conf.json' },
|
},
|
||||||
{ from: 'node_modules/monaco-editor/min/vs/', to: 'dist/vs/' },
|
|
||||||
],
|
|
||||||
proxy: {
|
|
||||||
'/api': {
|
|
||||||
target: 'http://ngsk.tech:29380',
|
|
||||||
changeOrigin: true,
|
|
||||||
},
|
},
|
||||||
'/databuilder/v1': {
|
devtool: process.env.NODE_ENV === 'production' ? false : 'source-map',
|
||||||
target: 'http://192.168.8.131:29380',
|
copy: [
|
||||||
changeOrigin: true,
|
{from: 'src/conf.json', to: 'dist/conf.json'},
|
||||||
pathRewrite: { '^/databuilder': '/' },
|
{from: 'node_modules/monaco-editor/min/vs/', to: 'dist/vs/'},
|
||||||
|
],
|
||||||
|
proxy: {
|
||||||
|
'/api': {
|
||||||
|
target: 'http://ngsk.tech:29380',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
|
'/databuilder/v1': {
|
||||||
|
// target: 'http://192.168.8.131:29380',
|
||||||
|
target: 'https://aistudio.ngsk.tech:7001/',
|
||||||
|
changeOrigin: true,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
writeToDisk: true,
|
||||||
writeToDisk: true,
|
chainWebpack(memo, args) {
|
||||||
chainWebpack(memo, args) {
|
memo.module.rule('markdown').test(/\.md$/).type('asset/source');
|
||||||
memo.module.rule('markdown').test(/\.md$/).type('asset/source');
|
|
||||||
|
|
||||||
memo.optimization.minimizer('terser').use(TerserPlugin);
|
memo.optimization.minimizer('terser').use(TerserPlugin);
|
||||||
|
|
||||||
return memo;
|
return memo;
|
||||||
},
|
},
|
||||||
tailwindcss: {},
|
tailwindcss: {},
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue