// https://umijs.org/config/ import { defineConfig } from 'umi' import routes from './routes' export default defineConfig({ hash: true, antd: {}, sass: {}, // dva: { // hmr: true, // disableModelsReExport: true, // lazyLoad: true, // }, history: { type: 'hash', }, 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: '@/components/PageLoading/index', }, define: { PORT: 4300, GENERATE_SOURCEMAP: false, REACT_APP_LOCALE: 'zh-Hans', REACT_APP_APP_BASE_URL: 'http://localhost:4200', // REACT_APP_MATERIAL_UPLOAD_URL: 'http://192.168.50.44:21022/api/Material/Upload', // REACT_APP_REMOTE_SERVICE_BASE_URL: 'http://192.168.50.44:21022', REACT_APP_MATERIAL_UPLOAD_URL: 'http://localhost:21028/api/Material/Upload', REACT_APP_MATERIAL_ZIP_URL: 'http://localhost:21028/api/Material/UploadZip', REACT_APP_REMOTE_SERVICE_BASE_URL: 'http://localhost:21028', // REACT_APP_WEIXIN_APPID: 'wx331ff3da84697769', REACT_APP_WEIXIN_APPID: 'wx9788037ac9f7521e', REACT_APP_SITE_NAME: '欢画', REACT_APP_SITE_SHORT_NAME: '欢画', REACT_APP_SITE_THEME: 'dark', UMI_ENV: 'huanart', }, copy: [ { from: 'node_modules/@aspnet/signalr/dist/browser/signalr.min.js', to: 'signalr.min.js', }, { from: 'node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.signalr-client.js', to: 'abp.signalr-client.js', }, { from: 'src/lib/abp.js', to: 'abp.js' }, { from: 'src/assets/sites', to: 'assets/sites' }, { from: 'src/assets/model', to: 'assets/model' }, { from: 'src/assets/theme', to: 'assets/theme' }, ], targets: { ie: 11, }, // umi routes: https://umijs.org/docs/routing routes, // Theme for antd: https://ant.design/docs/react/customize-theme-cn theme: { 'primary-color': '#b69665', 'tabs-vertical-margin': '8px 0 0 0', 'tabs-vertical-padding': '4px', }, title: false, ignoreMomentLocale: true, manifest: { basePath: '/', }, // 快速刷新功能 https://umijs.org/config#fastrefresh fastRefresh: {}, // esbuild: {}, // webpack5: {}, // mfsu: {}, // plugins: [], analyze: { analyzerMode: 'server', analyzerPort: 8888, openAnalyzer: true, // generate stats file while ANALYZE_DUMP exist generateStatsFile: false, statsFilename: 'stats.json', logLevel: 'info', defaultSizes: 'parsed', // stat // gzip }, chainWebpack(memo, { env, webpack, createCSSRule }) { memo.module .rule('mjs$') .test(/.mjs$/) .include.add(/node_modules/) .end() .type('javascript/auto') }, })