config.js 1.78 KB
Newer Older
1 2
// ref: https://umijs.org/config/
import { primaryColor } from '../src/defaultSettings';
3

4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
export default {
  plugins: [
    [
      'umi-plugin-react',
      {
        antd: true,
        dva: {
          hmr: true,
        },
        targets: {
          ie: 11,
        },
        locale: {
          enable: true, // default false
          default: 'zh-CN', // default zh-CN
          baseNavigator: true, // default true, when it is true, will use `navigator.language` overwrite default
        },
        dynamicImport: {
          loadingComponent: './components/PageLoading/index',
xiaoiver's avatar
xiaoiver committed
23 24
        },
      },
25
    ],
ๆ„š้“'s avatar
ๆ„š้“ committed
26 27 28 29 30 31 32 33 34
    [
      'umi-plugin-pro-block',
      {
        moveMock: false,
        moveService: false,
        modifyRequest: true,
        autoAddMenu: true,
      },
    ],
ๆ„š้“'s avatar
ๆ„š้“ committed
35
  ],
36 37 38
  targets: {
    ie: 11,
  },
39

40 41 42 43
  /**
   * ่ทฏ็”ฑ็›ธๅ…ณ้…็ฝฎ
   */
  routes: [
44
    {
45 46 47
      path: '/user',
      components: ['../layouts/UserLayout'],
      routes: [],
48
    },
49 50 51 52
    {
      path: '/',
      component: '../layouts/BasicLayout',
      routes: [
ๆ„š้“'s avatar
ๆ„š้“ committed
53
        { path: '/', redirect: '/welcome' },
54 55
        // dashboard
        {
ๆ„š้“'s avatar
ๆ„š้“ committed
56 57 58 59 60 61 62
          path: '/welcome',
          name: 'welcome',
          icon: 'smile',
          component: './Welcome',
        },
        {
          path: 'https://github.com/umijs/umi-blocks/tree/master/ant-design-pro',
ๆ„š้“'s avatar
ๆ„š้“ committed
63
          name: 'more-blocks',
ๆ„š้“'s avatar
ๆ„š้“ committed
64
          icon: 'block',
65 66 67 68 69
        },
      ],
    },
  ],
  disableRedirectHoist: true,
70

71 72 73
  /**
   * webpack ็›ธๅ…ณ้…็ฝฎ
   */
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
74
  define: {
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
75
    APP_TYPE: process.env.APP_TYPE || '',
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
76
  },
afc163's avatar
afc163 committed
77 78
  // Theme for antd
  // https://ant.design/docs/react/customize-theme-cn
ๆ„š้“'s avatar
ๆ„š้“ committed
79
  theme: {
80
    'primary-color': primaryColor,
ๆ„š้“'s avatar
ๆ„š้“ committed
81
  },
82 83 84 85 86 87 88
  externals: {
    '@antv/data-set': 'DataSet',
  },
  ignoreMomentLocale: true,
  lessLoaderOptions: {
    javascriptEnabled: true,
  },
ๆ„š้“'s avatar
ๆ„š้“ committed
89
};