Skip to content

Commit

Permalink
⚡️ Exclude node_modules by babel-loader.
Browse files Browse the repository at this point in the history
  • Loading branch information
zuiidea committed Mar 19, 2020
1 parent d2f391a commit 82b3a4b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .umirc.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export default {
dva: { immer: true },
antd: {},
dynamicImport: {
loading: 'components/Loader/Loader'
loading: 'components/Loader/Loader',
},
// not support in umi@3
// pwa: {
Expand All @@ -23,7 +23,9 @@ export default {
// },
// Theme for antd
// https://ant.design/docs/react/customize-theme
theme: lessToJs(fs.readFileSync(path.join(__dirname, './src/themes/default.less'), 'utf8')),
theme: lessToJs(
fs.readFileSync(path.join(__dirname, './src/themes/default.less'), 'utf8')
),
// Webpack Configuration
proxy: {
'/api/v1/weather': {
Expand Down Expand Up @@ -54,7 +56,17 @@ export default {
'lodash',
],
],
chainWebpack: function (config, { webpack }) {
chainWebpack: function(config, { webpack }) {
config.module
.rule('js-in-node_modules')
.exclude.add(/node_modules/)
.end()

config.module
.rule('ts-in-node_modules')
.exclude.add(/node_modules/)
.end()

config.merge({
optimization: {
minimize: true,
Expand Down

0 comments on commit 82b3a4b

Please sign in to comment.