diff --git a/.eslintrc.js b/.eslintrc.js index 53ee2fcf93f5343c0b9e9535815b0c008e8950b4..7372d96bce7291a91dbecf4a1c7ce9f14b1f862c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -11,6 +11,7 @@ module.exports = { }, globals: { page: true, + ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true, }, rules: { 'react/jsx-filename-extension': [1, { extensions: ['.js'] }], diff --git a/config/config.ts b/config/config.ts index dc4b7175b2e4933acd84509ac70b361ebca6862c..8a8f9f61b92b8267dcf8d55219e077a5c32b0f80 100644 --- a/config/config.ts +++ b/config/config.ts @@ -6,7 +6,8 @@ import defaultSettings from './defaultSettings'; import webpackPlugin from './plugin.config'; const { pwa, primaryColor } = defaultSettings; -// preview.pro.ant.design only do not use in your production ; preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 +// preview.pro.ant.design only do not use in your production ; +// preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 const { ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION, TEST, NODE_ENV } = process.env; const plugins: IPlugin[] = [ @@ -18,9 +19,12 @@ const plugins: IPlugin[] = [ hmr: true, }, 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 + // default false + enable: true, + // default zh-CN + default: 'zh-CN', + // default true, when it is true, will use `navigator.language` overwrite default + baseNavigator: true, }, dynamicImport: { loadingComponent: './components/PageLoading/index', @@ -67,17 +71,19 @@ if (ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') { }, ]); } -const uglifyJSOptions = NODE_ENV === 'production' - ? { - uglifyOptions: { - // remove console.* except console.error - compress: { - drop_console: true, - pure_funcs: [ 'console.error' ], + +const uglifyJSOptions = + NODE_ENV === 'production' + ? { + uglifyOptions: { + // remove console.* except console.error + compress: { + drop_console: true, + pure_funcs: ['console.error'], + }, }, - }, - } - : {}; + } + : {}; export default { // add for transfer to umi