Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

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