Showing
1 changed file
with
14 additions
and
16 deletions
| @@ -33,24 +33,22 @@ export default defineConfig({ | @@ -33,24 +33,22 @@ export default defineConfig({ | ||
| 33 | slave: {} | 33 | slave: {} | 
| 34 | }, | 34 | }, | 
| 35 | chainWebpack(memo, { env, webpack, createCSSRule }) { | 35 | chainWebpack(memo, { env, webpack, createCSSRule }) { | 
| 36 | - if (process.env.NODE_ENV === 'production') { | ||
| 37 | - memo.merge({ | ||
| 38 | - externals: function ({ context, request }: Record<string, string>, callback: any) { | ||
| 39 | - if (/^react$/.test(request)) { | ||
| 40 | - return callback(null, 'react', 'React'); | ||
| 41 | - } | 36 | + memo.merge({ | 
| 37 | + externals: function ({ context, request }: Record<string, string>, callback: any) { | ||
| 38 | + if (/^react$/.test(request)) { | ||
| 39 | + return callback(null, 'React', 'react'); | ||
| 40 | + } | ||
| 42 | 41 | ||
| 43 | - if (/^react-dom$/.test(request)) { | ||
| 44 | - return callback(null, 'react-dom', 'ReactDOM'); | ||
| 45 | - } | 42 | + if (/^react-dom$/.test(request)) { | 
| 43 | + return callback(null, 'ReactDOM', 'react-dom'); | ||
| 44 | + } | ||
| 46 | 45 | ||
| 47 | - if (/antd.*\.(css|less)$/.test(path.resolve(context, request))) { | ||
| 48 | - return callback(null, 'antd-style'); | ||
| 49 | - } | 46 | + if (/antd.*\.(css|less)$/.test(path.resolve(context, request))) { | 
| 47 | + return callback(null, 'antd-style'); | ||
| 48 | + } | ||
| 50 | 49 | ||
| 51 | - callback(); | ||
| 52 | - }, | ||
| 53 | - }); | ||
| 54 | - } | 50 | + callback(); | 
| 51 | + }, | ||
| 52 | + }); | ||
| 55 | }, | 53 | }, | 
| 56 | }); | 54 | }); |