import { IConfig } from 'umi-types';

const isDev = process.env.NODE_ENV === 'development';

// ref: https://umijs.org/config/
const config: IConfig =  {
  history: isDev ? undefined : 'hash',
  hash: true,
  publicPath: './',
  treeShaking: true,
  theme: {
    'primary-color': '#3A3A38',
  },
  plugins: [
    // ref: https://umijs.org/plugin/umi-plugin-react.html
    ['umi-plugin-react', {
      antd: true,
      dva: true,
      dynamicImport: {
        webpackChunkName: true,
        loadingComponent: './components/PageLoading/index',
      },
      title: 'vic',
      dll: true,
      locale: {
        enable: true,
        baseNavigator: true,
        default: 'en-US',
      },
      routes: {
        exclude: [
          /models\//,
          /services\//,
          /model\.(t|j)sx?$/,
          /service\.(t|j)sx?$/,
          /components\//,
        ],
      },
    }],
  ],
}

export default config;
