webpack-chain
介绍
webpack-chain 尝试通过提供可链式或顺流式的 API 创建和修改webpack 配置。API的 Key 部分可以由用户指定的名称引用,这有助于 跨项目修改配置方式 的标准化。
关联
Vue-Cli 与 webpack-chain
Vue-Cli 中chainWebpack
配置项是通过webpack-chain
来维护的。通过配置chainWebpack
达到在Vue-Cli
中链式配置webpack
的目的
// vue.config.js
module.exports = {
chainWebpack: config => {
config.module
.rule('vue')
.use('vue-loader')
.tap(options => {
// 修改它的选项...
return options
})
}
}