From 6c640900e725f1f7babaf385fa55c216867b4f8a Mon Sep 17 00:00:00 2001 From: Thorsten Date: Sat, 20 Apr 2019 12:56:57 +0200 Subject: [PATCH 1/2] docs: mention caveat about missing plugins when in legacy config close #3845 --- docs/guide/browser-compatibility.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/guide/browser-compatibility.md b/docs/guide/browser-compatibility.md index 3f605d3d67..a7c2e813b8 100644 --- a/docs/guide/browser-compatibility.md +++ b/docs/guide/browser-compatibility.md @@ -89,6 +89,12 @@ Vue CLI uses two environment variables to communicate this: **Important:** These variables are only accessible when/after `chainWebpack()` and `configureWebpack()` functions are evaluated, (so not directly in the `vue.config.js` module's root scope). That means it's also available in the postcss config file. ::: +::: warning Caveat: Adjusting webpack plugins +Some Plugins, i.e. `html-webpack-plugin`, `preload-plugin` etc. are only included in the config for modern mode. Trying to tap into their options in the legacy config can s an error as the plugins don't exist. + +Use the above tip about *Detecting the Current Mode* to manipulate plugins in the right mode only, and/or check if the plugin actually exists in the current mode's config before trying to tap into their options. +::: + [autoprefixer]: https://github.com/postcss/autoprefixer [babel-preset-env]: https://new.babeljs.io/docs/en/next/babel-preset-env.html [babel-preset-app]: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/babel-preset-app From 7d6576218f84e14c78d4b019b804371b39287626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorsten=20L=C3=BCnborg?= Date: Sat, 22 Jun 2019 11:48:08 +0200 Subject: [PATCH 2/2] Update browser-compatibility.md --- docs/guide/browser-compatibility.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/browser-compatibility.md b/docs/guide/browser-compatibility.md index a7c2e813b8..8942f8a5cd 100644 --- a/docs/guide/browser-compatibility.md +++ b/docs/guide/browser-compatibility.md @@ -90,7 +90,7 @@ Vue CLI uses two environment variables to communicate this: ::: ::: warning Caveat: Adjusting webpack plugins -Some Plugins, i.e. `html-webpack-plugin`, `preload-plugin` etc. are only included in the config for modern mode. Trying to tap into their options in the legacy config can s an error as the plugins don't exist. +Some Plugins, i.e. `html-webpack-plugin`, `preload-plugin` etc. are only included in the config for modern mode. Trying to tap into their options in the legacy config can throw an error as the plugins don't exist. Use the above tip about *Detecting the Current Mode* to manipulate plugins in the right mode only, and/or check if the plugin actually exists in the current mode's config before trying to tap into their options. :::