Skip to content

Conversation

sapphi-red
Copy link
Member

@sapphi-red sapphi-red commented May 7, 2025

Description

Introduces baseline-widely-available target alias and use that by default. The modules target alias that was the default is now removed.

This PR includes the following changes:

  • remove modules target alias
    • This was an alias of ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14'].
    • This was not the list of browsers that supports ESM, and was confusing
  • add baseline-widely-available target alias
    • This is a list of browsers compatible with Baseline Widely Available feature sets.
    • The list of browsers will be re-generated on each major version of Vite.
      • For Vite 7, I generated the list for 2025-05-01. The generated list is ['chrome107', 'edge107', 'firefox104', 'safari16'].
      • I added a script to generate the list at packages/vite/scripts/generateTarget.ts and can be ran by pnpm run generate-target.
  • make baseline-widely-available to be the default value of build.target
  • update tsconfig.json in templates to use "target": "ES2022" and "lib": ["ES2022", ...]

close #19358

@sapphi-red sapphi-red added this to the 7.0 milestone May 7, 2025
@sapphi-red sapphi-red added breaking change p3-significant High priority enhancement (priority) labels May 7, 2025
patak-dev
patak-dev previously approved these changes May 7, 2025
Copy link
Member

@patak-dev patak-dev left a comment

Choose a reason for hiding this comment

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

looks great! I thought we could name it just baseline, but I see that would be confusing. The explicit name is correct and people won't be typing it anyways

Copy link

@vegerot vegerot left a comment

Choose a reason for hiding this comment

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

lgtm! Coincidentally I suggested the same thing yesterday for Rspack web-infra-dev/rspack#10290

@sapphi-red sapphi-red merged commit 4a8aa82 into vitejs:main May 22, 2025
14 checks passed
@sapphi-red sapphi-red deleted the feat/bump-build-target branch May 22, 2025 10:01
moonlitusun pushed a commit to moonlitusun/vite that referenced this pull request May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change p3-significant High priority enhancement (priority)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bump default build.target
3 participants