From b0b62f96d7d4b04d3bfea683feff84c8b31f1eca Mon Sep 17 00:00:00 2001 From: Nihal Gonsalves Date: Wed, 12 May 2021 20:40:17 +0200 Subject: [PATCH] docs(plugin-legacy): add note about IE11, close #3362 (#3389) --- packages/plugin-legacy/README.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/plugin-legacy/README.md b/packages/plugin-legacy/README.md index 240f7d63783f52..cd7bdf8dce5177 100644 --- a/packages/plugin-legacy/README.md +++ b/packages/plugin-legacy/README.md @@ -29,6 +29,22 @@ export default { } ``` +When targeting IE11, you also need `regenerator-runtime`: + +```js +// vite.config.js +import legacy from '@vitejs/plugin-legacy' + +export default { + plugins: [ + legacy({ + targets: ['ie >= 11'], + additionalLegacyPolyfills: ['regenerator-runtime/runtime'] + }) + ] +} +``` + ## Options ### `targets` @@ -57,7 +73,7 @@ export default { Add custom imports to the legacy polyfills chunk. Since the usage-based polyfill detection only covers ES language features, it may be necessary to manually specify additional DOM API polyfills using this option. - Note: if additional plyfills are needed for both the modern and legacy chunks, they can simply be imported in the application source code. + Note: if additional polyfills are needed for both the modern and legacy chunks, they can simply be imported in the application source code. ### `ignoreBrowserslistConfig`