webpack 环境区分
在使用webpack-merge 进行环境区分的时候,编译报错, TypeError: merge is not a function
const merge = require('webpack-merge')
const baseConfig = require('./webpack.base.config')
const proConfig = {
mode: 'production'
}
module.exports = merge(baseConfig, proConfig)
webpack4 之后,正确的做法
const { merge } = require('webpack-merge')
通过ES6的解构