feat: update env configs and add team canvas endpoint
This commit is contained in:
@@ -4,17 +4,17 @@ import { defineConfig } from 'umi';
|
||||
import { appName } from './src/conf.json';
|
||||
import routes from './src/routes';
|
||||
const ESLintPlugin = require('eslint-webpack-plugin');
|
||||
const RAGFLOW_BASE = process.env.RAGFLOW_BASE || '/';
|
||||
|
||||
export default defineConfig({
|
||||
title: appName,
|
||||
outputPath: 'dist',
|
||||
alias: { '@parent': path.resolve(__dirname, '../') },
|
||||
npmClient: 'pnpm',
|
||||
base: '/',
|
||||
base: RAGFLOW_BASE,
|
||||
routes,
|
||||
publicPath: '/',
|
||||
publicPath: RAGFLOW_BASE,
|
||||
esbuildMinifyIIFE: true,
|
||||
icons: {},
|
||||
hash: true,
|
||||
favicons: ['/logo.svg'],
|
||||
headScripts: [{ src: '/iconfont.js', defer: true }],
|
||||
@@ -24,7 +24,6 @@ export default defineConfig({
|
||||
},
|
||||
plugins: [
|
||||
'@react-dev-inspector/umi4-plugin',
|
||||
'@umijs/plugins/dist/tailwindcss',
|
||||
],
|
||||
jsMinifier: 'none', // Fixed the issue that the page displayed an error after packaging lexical with terser
|
||||
lessLoader: {
|
||||
@@ -32,26 +31,32 @@ export default defineConfig({
|
||||
hack: `true; @import "~@/less/index.less";`,
|
||||
},
|
||||
},
|
||||
devtool: 'source-map',
|
||||
// devtool: 'source-map',
|
||||
// Speed up dev startup by using cheaper source maps
|
||||
devtool: process.env.NODE_ENV === 'development'
|
||||
? 'eval-cheap-module-source-map'
|
||||
: 'source-map',
|
||||
copy: [
|
||||
{ from: 'src/conf.json', to: 'dist/conf.json' },
|
||||
{ from: 'node_modules/monaco-editor/min/vs/', to: 'dist/vs/' },
|
||||
],
|
||||
proxy: [
|
||||
{
|
||||
context: ['/api', '/v1'],
|
||||
target: 'http://127.0.0.1:9380/',
|
||||
changeOrigin: true,
|
||||
ws: true,
|
||||
logger: console,
|
||||
// {
|
||||
// context: ['/api', '/v1'],
|
||||
// target: 'http://154.9.253.114:9380',
|
||||
// target: 'http://150.158.121.95',
|
||||
// changeOrigin: true,
|
||||
// ws: true,
|
||||
// logger: console,
|
||||
// pathRewrite: { '^/v1': '/v1' },
|
||||
},
|
||||
// },
|
||||
],
|
||||
|
||||
chainWebpack(memo, args) {
|
||||
memo.module.rule('markdown').test(/\.md$/).type('asset/source');
|
||||
|
||||
memo.optimization.minimizer('terser').use(TerserPlugin); // Fixed the issue that the page displayed an error after packaging lexical with terser
|
||||
memo.optimization.minimizer('terser').use(TerserPlugin);
|
||||
// Fixed the issue that the page displayed an error after packaging lexical with terser
|
||||
|
||||
// memo.plugin('eslint').use(ESLintPlugin, [
|
||||
// {
|
||||
@@ -61,13 +66,6 @@ export default defineConfig({
|
||||
// files: ['src/**/*.{js,ts,tsx}'],
|
||||
// },
|
||||
// ]);
|
||||
|
||||
return memo;
|
||||
},
|
||||
tailwindcss: {
|
||||
// 显式指定入口样式,避免默认路径不一致导致生成超时
|
||||
cssPath: 'tailwind.css',
|
||||
// 明确配置文件路径,配合 monorepo 场景更稳妥
|
||||
configPath: 'tailwind.config.js',
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user