您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

.umirc.ts 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import path from 'path';
  2. import TerserPlugin from 'terser-webpack-plugin';
  3. import { defineConfig } from 'umi';
  4. import { appName } from './src/conf.json';
  5. import routes from './src/routes';
  6. export default defineConfig({
  7. title: appName,
  8. outputPath: 'dist/ss-rag',
  9. alias: { '@parent': path.resolve(__dirname, '../') },
  10. npmClient: 'npm',
  11. base: '/ss-rag/',
  12. routes,
  13. publicPath: '/ss-rag/',
  14. esbuildMinifyIIFE: true,
  15. icons: {},
  16. hash: true,
  17. favicons: ['/logo.svg'],
  18. clickToComponent: {},
  19. history: {
  20. type: 'browser',
  21. },
  22. exportStatic: {},
  23. plugins: [
  24. '@react-dev-inspector/umi4-plugin',
  25. '@umijs/plugins/dist/tailwindcss',
  26. ],
  27. jsMinifier: 'none', // Fixed the issue that the page displayed an error after packaging lexical with terser
  28. lessLoader: {
  29. modifyVars: {
  30. hack: `true; @import "~@/less/index.less";`,
  31. },
  32. },
  33. devtool: 'source-map',
  34. copy: [
  35. { from: 'src/conf.json', to: 'dist/conf.json' },
  36. { from: 'node_modules/monaco-editor/min/vs/', to: 'dist/vs/' },
  37. ],
  38. proxy: [
  39. {
  40. context: ['/api', '/v1'],
  41. target: 'http://127.0.0.1:9380/',
  42. changeOrigin: true,
  43. ws: true,
  44. logger: console,
  45. // pathRewrite: { '^/v1': '/v1' },
  46. },
  47. ],
  48. chainWebpack(memo, args) {
  49. memo.module.rule('markdown').test(/\.md$/).type('asset/source');
  50. memo.optimization.minimizer('terser').use(TerserPlugin); // Fixed the issue that the page displayed an error after packaging lexical with terser
  51. return memo;
  52. },
  53. tailwindcss: {},
  54. });