config.js 1.42 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
  targets: {
    ie: 11,
  },
30

31 32 33 34
  /**
   * ่ทฏ็”ฑ็›ธๅ…ณ้…็ฝฎ
   */
  routes: [
35
    {
36 37 38
      path: '/user',
      components: ['../layouts/UserLayout'],
      routes: [],
39
    },
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
    {
      path: '/',
      component: '../layouts/BasicLayout',
      routes: [
        // dashboard
        {
          path: '/',
          name: 'dashboard',
          icon: 'dashboard',
          component: './BasicDemo',
        },
      ],
    },
  ],
  disableRedirectHoist: true,
55

56 57 58
  /**
   * webpack ็›ธๅ…ณ้…็ฝฎ
   */
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
59
  define: {
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
60
    APP_TYPE: process.env.APP_TYPE || '',
้™ˆๅธ…'s avatar
้™ˆๅธ… committed
61
  },
afc163's avatar
afc163 committed
62 63
  // Theme for antd
  // https://ant.design/docs/react/customize-theme-cn
ๆ„š้“'s avatar
ๆ„š้“ committed
64
  theme: {
65
    'primary-color': primaryColor,
ๆ„š้“'s avatar
ๆ„š้“ committed
66
  },
67 68 69 70 71 72 73
  externals: {
    '@antv/data-set': 'DataSet',
  },
  ignoreMomentLocale: true,
  lessLoaderOptions: {
    javascriptEnabled: true,
  },
ๆ„š้“'s avatar
ๆ„š้“ committed
74
};