ragflow/web/.umirc.ts
balibabu 285fd6ae14
feat: Proxy the SDK address to the backend #3166 (#3171)
### What problem does this PR solve?

feat: Proxy the SDK address to the backend #3166

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
2024-11-04 11:37:19 +08:00

47 lines
1.0 KiB
TypeScript

import path from 'path';
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: '/',
routes,
publicPath: '/',
esbuildMinifyIIFE: true,
icons: {},
hash: true,
favicons: ['/logo.svg'],
clickToComponent: {},
history: {
type: 'browser',
},
plugins: ['@react-dev-inspector/umi4-plugin'],
jsMinifier: 'terser',
lessLoader: {
modifyVars: {
hack: `true; @import "~@/less/index.less";`,
},
},
devtool: 'source-map',
copy: ['src/conf.json'],
proxy: [
{
context: ['/api', '/v1'],
target: 'http://127.0.0.1:9380/',
changeOrigin: true,
ws: true,
logger: console,
// pathRewrite: { '^/v1': '/v1' },
},
],
chainWebpack(memo, args) {
memo.module.rule('markdown').test(/\.md$/).type('asset/source');
return memo;
},
});