Skip to content

Commit 09ce29f

Browse files
LinusBorgNataliaTepluhina
authored andcommitted
docs: mention caveat about missing plugins when in legacy config (#3857)
* docs: mention caveat about missing plugins when in legacy config close #3845 * Update browser-compatibility.md
1 parent af25ef7 commit 09ce29f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docs/guide/browser-compatibility.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ Vue CLI uses two environment variables to communicate this:
8989
**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.
9090
:::
9191
92+
::: warning Caveat: Adjusting webpack plugins
93+
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.
94+
95+
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.
96+
:::
97+
9298
[autoprefixer]: https://github.com/postcss/autoprefixer
9399
[babel-preset-env]: https://new.babeljs.io/docs/en/next/babel-preset-env.html
94100
[babel-preset-app]: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/babel-preset-app

0 commit comments

Comments
 (0)