You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

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