import * as path from 'path'; import { IConfig } from 'umi-types'; // ref: https://umijs.org/config/ const config: IConfig = { history: 'hash', treeShaking: true, disableGlobalVariables: true, "define": { "process.env.API_ENV": process.env.API_ENV }, devtool: 'cheap-module-eval-source-map', plugins: [ // ref: https://umijs.org/plugin/umi-plugin-react.html ['umi-plugin-react', { antd: true, dva: { immer: true }, dynamicImport: false, title: 'game_name', dll: false, locale: { default: 'zh-CN', //默认语言 zh-CN baseNavigator: true, // 为true时,用navigator.language的值作为默认语言 antd: true, // 是否启用antd的 }, routes: { exclude: [ /models\//, /services\//, /model\.(t|j)sx?$/, /service\.(t|j)sx?$/, /components\//, ], }, }], ], routes: [ { path: '/', component: '../layouts/index', routes: [ { path: '/', component: './main' }, { path: '/main', component: './main' }, { path: '/game', component: './game' }, { path: '/rank', component: './rank' }, ], }, ], } export default config;