Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: support safari14 by default for wider ES2020 compatibility #9063

Merged
merged 3 commits into from Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/guide/build.md
Expand Up @@ -8,7 +8,7 @@ The production bundle assumes support for modern JavaScript. By default, Vite ta

- Chrome >=87
- Firefox >=78
- Safari >=13
- Safari >=14
- Edge >=88

You can specify custom targets via the [`build.target` config option](/config/build-options.md#build-target), where the lowest target is `es2015`.
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/constants.ts
Expand Up @@ -22,7 +22,7 @@ export const ESBUILD_MODULES_TARGET = [
'edge88',
'firefox78',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean this?
(+ undoing the other change)

Suggested change
'firefox78',
'firefox71', // transpile nullish coalescing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean reverting to safari 13.1, as you said this issue wasn't present in v2.9 + es2020. But I think safari 14 is needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Safari 13.1 wouldn't help for compat in this case: https://caniuse.com/bigint

'chrome87',
'safari13' // transpile nullish coalescing
'safari14'
]

export const DEFAULT_EXTENSIONS = [
Expand Down