config.js 1.38 KB
Newer Older
wuhao's avatar
wuhao committed
1 2 3 4 5 6 7 8
// https://umijs.org/config/
import { defineConfig } from "umi";
import { join } from "path";
import defaultSettings from "./defaultSettings";
import proxy from "./proxy";
import routes from "./routes";
const { REACT_APP_ENV } = process.env;
export default defineConfig({
wuhao's avatar
wuhao committed
9
  outputPath: 'wms',
wuhao's avatar
wuhao committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
  hash: true,
  antd: {},
  dva: {
    hmr: true,
  },
  layout: {
    // https://umijs.org/zh-CN/plugins/plugin-layout
    locale: true,
    siderWidth: 208,
    ...defaultSettings,
  },
  // https://umijs.org/zh-CN/plugins/plugin-locale
  locale: {
    // default zh-CN
    default: "zh-CN",
    antd: true,
    // default true, when it is true, will use `navigator.language` overwrite default
    baseNavigator: true,
  },
  dynamicImport: {
    loading: "@ant-design/pro-layout/es/PageLoading",
  },
  targets: {
    ie: 11,
  },
  // umi routes: https://umijs.org/docs/routing
  routes,
  // Theme for antd: https://ant.design/docs/react/customize-theme-cn
  theme: {
    "root-entry-name": "variable",
  },
  // esbuild is father build tools
  // https://umijs.org/plugins/plugin-esbuild
  esbuild: {},
  title: false,
  ignoreMomentLocale: true,
  proxy: proxy[REACT_APP_ENV || "dev"],
  history: {
    type: "hash",
  },
  publicPath: "./",
  manifest: {
    basePath: "/",
  },
  // Fast Refresh 热更新
  fastRefresh: {},
  nodeModulesTransform: {
    type: "all",
  },
  //mfsu: {},
  //webpack5: {}
});