.umirc.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import path, { resolve } from 'path';
  2. export default {
  3. chainWebpack(memo, { env, webpack, createCSSRule }) {
  4. },
  5. // for query-string@6 https://github.com/sorrycc/blog/issues/68
  6. es5ImcompatibleVersions: true,
  7. plugins: [
  8. [
  9. 'umi-plugin-react',
  10. {
  11. dva: true,
  12. antd: true,
  13. routes: {
  14. exclude: [
  15. /model\.(j|t)sx?$/,
  16. /service\.(j|t)sx?$/,
  17. /models\//,
  18. /components\//,
  19. /services\//
  20. ]
  21. },
  22. dll: {
  23. exclude: [],
  24. include: ["dva", "dva/router", "dva/saga", "dva/fetch", "antd/es"]
  25. }
  26. }
  27. ]
  28. ],
  29. theme: "./theme.config.js",
  30. proxy: {
  31. // "/api/v1/weather": {
  32. // "target": "https://api.seniverse.com/",
  33. // "changeOrigin": true,
  34. // "pathRewrite": { "^/api/v1/weather": "/v3/weather" }
  35. // }
  36. },
  37. alias: {
  38. themes: resolve(__dirname, './src/themes'),
  39. components: resolve(__dirname, "./src/components"),
  40. utils: resolve(__dirname, "./src/utils"),
  41. config: resolve(__dirname, "./src/utils/config"),
  42. services: resolve(__dirname, "./src/services"),
  43. models: resolve(__dirname, "./src/models"),
  44. routes: resolve(__dirname, "./src/routes"),
  45. },
  46. urlLoaderExcludes: [
  47. /\.svg$/
  48. ],
  49. // inlineLimit: 20000
  50. }