.umirc.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. // ref: https://umijs.org/config/
  2. export default {
  3. treeShaking: true,
  4. routes: [
  5. {
  6. path: '/',
  7. component: '../layouts/index',
  8. routes: [
  9. { path: '/', component: '../pages/Home' },
  10. { path: '/cardList', component: '../pages/CardList' }
  11. ]
  12. }
  13. ],
  14. plugins: [
  15. // ref: https://umijs.org/plugin/umi-plugin-react.html
  16. ['umi-plugin-react', {
  17. antd: false,
  18. dva: true,
  19. dynamicImport: false,
  20. dll: false,
  21. hd: true,
  22. locale: {
  23. default: 'zh-CN', //默认语言 zh-CN,如果 baseSeparator 设置为 _,则默认为 zh_CN
  24. baseNavigator: true, // 为true时,用navigator.language的值作为默认语言
  25. antd: true, // 是否启用antd的<LocaleProvider />
  26. baseSeparator: '-', // 语言默认分割符 -
  27. },
  28. routes: {
  29. exclude: [
  30. /models\//,
  31. /services\//,
  32. /model\.(t|j)sx?$/,
  33. /service\.(t|j)sx?$/,
  34. /components\//,
  35. ],
  36. },
  37. //CDN引入
  38. links: [
  39. { href: 'http://sp.qn.paqukeji.com/static/antd-mobile/2.3.1/antd-mobile.min.css', rel: 'stylesheet' }
  40. ],
  41. headScripts: [
  42. //react
  43. 'http://sp.qn.paqukeji.com/static/react/16.9.0/react.production.min.js',
  44. //react-dom
  45. 'http://sp.qn.paqukeji.com/static/react/16.9.0/react-dom.production.min.js',
  46. //antd-mobile
  47. 'http://sp.qn.paqukeji.com/static/antd-mobile/2.3.1/antd-mobile.min.js'
  48. ]
  49. }],
  50. ],
  51. lessLoaderOptions: {
  52. javascriptEnabled: true,
  53. },
  54. extraBabelPlugins: [
  55. ["import", { libraryName: "antd-mobile", style: true }] // `style: true` 会加载 less 文件
  56. ],
  57. proxy: {
  58. '/api-app': {
  59. target: 'http://api.starbuds.laylib.com',
  60. changeOrigin: true,
  61. //pathRewrite: { '^/server': '' },
  62. },
  63. '/api-common': {
  64. target: 'http://api.starbuds.laylib.com',
  65. changeOrigin: true,
  66. //pathRewrite: { '^/server': '' },
  67. },
  68. },
  69. hash: true,
  70. outputPath: './niceNum',
  71. externals: {
  72. 'react': 'React',
  73. 'react-dom': 'ReactDOM',
  74. 'antd-mobile': 'antd-mobile',
  75. },
  76. }