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