Skip to content

Commit b82ee5d

Browse files
authored
docs: update browser baseline features (#9316)
1 parent 2415193 commit b82ee5d

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

docs/config/build-options.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- **Default:** `'modules'`
77
- **Related:** [Browser Compatibility](/guide/build#browser-compatibility)
88

9-
Browser compatibility target for the final bundle. The default value is a Vite special value, `'modules'`, which targets browsers with [native ES Modules](https://caniuse.com/es6-module) and [native ESM dynamic import](https://caniuse.com/es6-module-dynamic-import) support.
9+
Browser compatibility target for the final bundle. The default value is a Vite special value, `'modules'`, which targets browsers with [native ES Modules](https://caniuse.com/es6-module), [native ESM dynamic import](https://caniuse.com/es6-module-dynamic-import), and [`import.meta`](https://caniuse.com/mdn-javascript_statements_import_meta) support.
1010

1111
Another special value is `'esnext'` - which assumes native dynamic imports support and will transpile as little as possible:
1212

docs/guide/build.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ When it is time to deploy your app for production, simply run the `vite build` c
44

55
## Browser Compatibility
66

7-
The production bundle assumes support for modern JavaScript. By default, Vite targets browsers which support the [native ES Modules](https://caniuse.com/es6-module) and [native ESM dynamic import](https://caniuse.com/es6-module-dynamic-import) and [`import.meta`](https://caniuse.com/mdn-javascript_statements_import_meta):
7+
The production bundle assumes support for modern JavaScript. By default, Vite targets browsers which support the [native ES Modules](https://caniuse.com/es6-module), [native ESM dynamic import](https://caniuse.com/es6-module-dynamic-import), and [`import.meta`](https://caniuse.com/mdn-javascript_statements_import_meta):
88

99
- Chrome >=87
1010
- Firefox >=78

docs/guide/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ You can learn more about the rationale behind the project in the [Why Vite](./wh
1818

1919
## Browser Support
2020

21-
The default build targets browsers that support both [native ES Modules](https://caniuse.com/es6-module) and [native ESM dynamic import](https://caniuse.com/es6-module-dynamic-import). Legacy browsers can be supported via the official [@vitejs/plugin-legacy](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy) - see the [Building for Production](./build) section for more details.
21+
The default build targets browsers that support [native ES Modules](https://caniuse.com/es6-module), [native ESM dynamic import](https://caniuse.com/es6-module-dynamic-import), and [`import.meta`](https://caniuse.com/mdn-javascript_statements_import_meta). Legacy browsers can be supported via the official [@vitejs/plugin-legacy](https://github.com/vitejs/vite/tree/main/packages/plugin-legacy) - see the [Building for Production](./build) section for more details.
2222

2323
## Trying Vite Online
2424

docs/guide/migration.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Vite no longer supports Node.js 12 / 13 / 15, which reached its EOL. Node.js 14.
66

77
## Modern Browser Baseline change
88

9-
The production bundle assumes support for modern JavaScript. By default, Vite targets browsers which support the [native ES Modules](https://caniuse.com/es6-module) and [native ESM dynamic import](https://caniuse.com/es6-module-dynamic-import) and [`import.meta`](https://caniuse.com/mdn-javascript_statements_import_meta):
9+
The production bundle assumes support for modern JavaScript. By default, Vite targets browsers which support the [native ES Modules](https://caniuse.com/es6-module), [native ESM dynamic import](https://caniuse.com/es6-module-dynamic-import), and [`import.meta`](https://caniuse.com/mdn-javascript_statements_import_meta):
1010

1111
- Chrome >=87
1212
- Firefox >=78

packages/vite/src/node/constants.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ export const DEFAULT_MAIN_FIELDS = [
1111
'jsnext'
1212
]
1313

14-
// Support browserslist
15-
// "defaults and supports es6-module and supports es6-module-dynamic-import",
14+
// Baseline support browserslist
15+
// "defaults and supports es6-module and supports es6-module-dynamic-import"
16+
// Higher browser versions may be needed for extra features.
1617
export const ESBUILD_MODULES_TARGET = [
1718
'es2020', // support import.meta.url
1819
'edge88',

0 commit comments

Comments
 (0)