module.exports = { chainWebpack: config => { config .pugin('插件名字') .use(引入的插件的变量, 必定不要使用new 关键字) .tag: c => { // c 是一个数组 c[0] = {插件的配置项} return c; } } }
// 引入 vconsole-webpack-plugin const VconsoleWebpackPlugin = require('vconsole-webpack-plugin') module.exports = { chainWebpack: config => { config .pugin('Vconsole') .use(VconsoleWebpackPlugin) // 不要 new .tag: c => { // c 是一个数组 c[0] = {enable: true} return c; } } }