Skip to content

Latest commit

 

History

History
26 lines (24 loc) · 887 Bytes

vue.config.js_plugins_is_not_allowed.md

File metadata and controls

26 lines (24 loc) · 887 Bytes
title staticFileName author createDate description keywords category
vue.config.js: 'plugins' is not allowed
vue_cfg_plugins.html
guoqzuo
2020/11/30
在 vue.config.js 中,webpack 相关的配置需要写到 configureWebpack 里,不能直接写到外面,否则会报错:vue.config.js: 'plugins' is not allowed。
plugins is not allowed
Vue

vue.config.js: "plugins" is not allowed

在 vue.config.js 中,webpack 相关的配置需要写到 configureWebpack 里,不能直接写到外面,否则会报错:vue.config.js: 'plugins' is not allowed。

vue_config_js_plugins.png

// vue.config.js
module.exports = {
  plugins: [], // error,"plugins" is not allowed
  configureWebpack: {
    plugins: [], // 正确写法
    externals: {}
  }
};