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.

.umirc.ts 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import path from 'path';
  2. import { defineConfig } from 'umi';
  3. import routes from './src/routes';
  4. const cMapsDir = path.join(
  5. path.dirname(require.resolve('pdfjs-dist/package.json')),
  6. 'cmaps',
  7. );
  8. const standardFontsDir = path.join(
  9. path.dirname(require.resolve('pdfjs-dist/package.json')),
  10. 'standard_fonts',
  11. );
  12. export default defineConfig({
  13. outputPath: 'dist',
  14. // alias: { '@': './src' },
  15. npmClient: 'npm',
  16. base: '/',
  17. routes,
  18. publicPath: '/',
  19. esbuildMinifyIIFE: true,
  20. icons: {},
  21. hash: true,
  22. history: {
  23. type: 'browser',
  24. },
  25. plugins: ['@react-dev-inspector/umi4-plugin', '@umijs/plugins/dist/dva'],
  26. dva: {},
  27. lessLoader: {
  28. modifyVars: {
  29. hack: `true; @import "~@/less/variable.less";`,
  30. },
  31. },
  32. proxy: {
  33. '/v1': {
  34. target: 'http://123.60.95.134:9380/',
  35. changeOrigin: true,
  36. // pathRewrite: { '^/v1': '/v1' },
  37. },
  38. },
  39. copy: [
  40. { from: cMapsDir, to: 'cmaps/' },
  41. { from: standardFontsDir, to: 'standard_fonts/' },
  42. ],
  43. chainWebpack(memo, args) {
  44. console.info(memo);
  45. },
  46. });