2024-10-17 11:36:01 +08:00
|
|
|
import path from 'path';
|
2024-07-04 19:18:02 +08:00
|
|
|
import { defineConfig } from 'umi';
|
|
|
|
import { appName } from './src/conf.json';
|
|
|
|
import routes from './src/routes';
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
title: appName,
|
|
|
|
outputPath: 'dist',
|
2024-10-17 16:03:13 +08:00
|
|
|
alias: { '@parent': path.resolve(__dirname, '../') },
|
2024-07-04 19:18:02 +08:00
|
|
|
npmClient: 'npm',
|
|
|
|
base: '/',
|
|
|
|
routes,
|
|
|
|
publicPath: '/',
|
|
|
|
esbuildMinifyIIFE: true,
|
|
|
|
icons: {},
|
|
|
|
hash: true,
|
|
|
|
favicons: ['/logo.svg'],
|
|
|
|
clickToComponent: {},
|
|
|
|
history: {
|
|
|
|
type: 'browser',
|
|
|
|
},
|
2024-11-06 11:13:04 +08:00
|
|
|
plugins: [
|
|
|
|
'@react-dev-inspector/umi4-plugin',
|
|
|
|
'@umijs/plugins/dist/tailwindcss',
|
|
|
|
],
|
2024-07-24 18:27:03 +08:00
|
|
|
jsMinifier: 'terser',
|
2024-07-04 19:18:02 +08:00
|
|
|
lessLoader: {
|
|
|
|
modifyVars: {
|
|
|
|
hack: `true; @import "~@/less/index.less";`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
devtool: 'source-map',
|
2024-12-27 15:03:42 +08:00
|
|
|
copy: [
|
|
|
|
{ from: 'src/conf.json', to: 'dist/conf.json' },
|
|
|
|
{ from: 'node_modules/monaco-editor/min/vs/', to: 'dist/vs/' },
|
|
|
|
],
|
2024-11-04 11:37:19 +08:00
|
|
|
proxy: [
|
|
|
|
{
|
|
|
|
context: ['/api', '/v1'],
|
2024-11-28 15:25:38 +08:00
|
|
|
target: 'http://127.0.0.1:9380/',
|
2024-09-10 11:25:12 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
ws: true,
|
|
|
|
logger: console,
|
|
|
|
// pathRewrite: { '^/v1': '/v1' },
|
|
|
|
},
|
2024-11-04 11:37:19 +08:00
|
|
|
],
|
2024-11-06 11:13:04 +08:00
|
|
|
|
2024-10-16 15:57:39 +08:00
|
|
|
chainWebpack(memo, args) {
|
2024-10-17 16:03:13 +08:00
|
|
|
memo.module.rule('markdown').test(/\.md$/).type('asset/source');
|
2024-10-16 15:57:39 +08:00
|
|
|
|
|
|
|
return memo;
|
|
|
|
},
|
2024-11-06 11:13:04 +08:00
|
|
|
tailwindcss: {},
|
2024-07-04 19:18:02 +08:00
|
|
|
});
|