Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. const ESLintPlugin = require('eslint-webpack-plugin');
  7. export default defineConfig({
  8. title: appName,
  9. outputPath: 'dist/ss-rag',
  10. alias: { '@parent': path.resolve(__dirname, '../') },
  11. npmClient: 'npm',
  12. base: '/ss-rag/',
  13. routes,
  14. publicPath: '/ss-rag/',
  15. esbuildMinifyIIFE: true,
  16. icons: {},
  17. hash: true,
  18. favicons: ['/logo.svg'],
  19. headScripts: [{ src: '/iconfont.js', defer: true }],
  20. clickToComponent: {},
  21. history: {
  22. type: 'browser',
  23. },
  24. exportStatic: {},
  25. plugins: [
  26. '@react-dev-inspector/umi4-plugin',
  27. '@umijs/plugins/dist/tailwindcss',
  28. ],
  29. jsMinifier: 'none', // Fixed the issue that the page displayed an error after packaging lexical with terser
  30. lessLoader: {
  31. modifyVars: {
  32. hack: `true; @import "~@/less/index.less";`,
  33. },
  34. },
  35. devtool: 'source-map',
  36. copy: [
  37. { from: 'src/conf.json', to: 'dist/conf.json' },
  38. { from: 'node_modules/monaco-editor/min/vs/', to: 'dist/vs/' },
  39. ],
  40. proxy: [
  41. {
  42. context: ['/api', '/v1'],
  43. target: 'http://127.0.0.1:9380/',
  44. changeOrigin: true,
  45. ws: true,
  46. logger: console,
  47. // pathRewrite: { '^/v1': '/v1' },
  48. },
  49. ],
  50. chainWebpack(memo, args) {
  51. memo.module.rule('markdown').test(/\.md$/).type('asset/source');
  52. memo.optimization.minimizer('terser').use(TerserPlugin); // Fixed the issue that the page displayed an error after packaging lexical with terser
  53. // memo.plugin('eslint').use(ESLintPlugin, [
  54. // {
  55. // extensions: ['js', 'ts', 'tsx'],
  56. // failOnError: true,
  57. // exclude: ['**/node_modules/**', '**/mfsu**', '**/mfsu-virtual-entry**'],
  58. // files: ['src/**/*.{js,ts,tsx}'],
  59. // },
  60. // ]);
  61. return memo;
  62. },
  63. tailwindcss: {},
  64. });