diff --git a/docs/guide/build.md b/docs/guide/build.md index 9768db29ba67b3..6c4f2a1e5523ab 100644 --- a/docs/guide/build.md +++ b/docs/guide/build.md @@ -13,7 +13,7 @@ The production bundle assumes support for modern JavaScript. By default, Vite ta You can specify custom targets via the [`build.target` config option](/config/build-options.md#build-target), where the lowest target is `es2015`. -Note that by default, Vite only handles syntax transforms and **does not cover polyfills**. You can check out [Polyfill JS](https://cdnjs.cloudflare.com/polyfill/) which is a service that automatically generates polyfill bundles based on the user's browser UserAgent string. +Note that by default, Vite only handles syntax transforms and **does not cover polyfills**. You can check out https://cdnjs.cloudflare.com/polyfill/ which automatically generates polyfill bundles based on the user's browser UserAgent string. Legacy browsers can be supported via [@vitejs/plugin-legacy](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy), which will automatically generate legacy chunks and corresponding ES language feature polyfills. The legacy chunks are conditionally loaded only in browsers that do not have native ESM support. diff --git a/packages/plugin-legacy/README.md b/packages/plugin-legacy/README.md index 055cb6678c1bef..ad90980609a285 100644 --- a/packages/plugin-legacy/README.md +++ b/packages/plugin-legacy/README.md @@ -91,7 +91,7 @@ npm add -D terser If `modernTargets` is not set, it is **not recommended** to use the `true` value (which uses auto-detection) because `core-js@3` is very aggressive in polyfill inclusions due to all the bleeding edge features it supports. Even when targeting native ESM support, it injects 15kb of polyfills! - If you don't have hard reliance on bleeding edge runtime features, it is not that hard to avoid having to use polyfills in the modern build altogether. Alternatively, consider setting `modernTargets` or using an on-demand service like [Polyfill.io](https://polyfill.io) to only inject necessary polyfills based on actual browser user-agents (most modern browsers will need nothing!). + If you don't have hard reliance on bleeding edge runtime features, it is not that hard to avoid having to use polyfills in the modern build altogether. Alternatively, consider setting `modernTargets` or using an on-demand service like https://cdnjs.cloudflare.com/polyfill/ to only inject necessary polyfills based on actual browser user-agents (most modern browsers will need nothing!). ### `renderLegacyChunks`