Skip to content

Commit 368b93c

Browse files
committed
chore: merge main
2 parents 0e4553b + a6e1edf commit 368b93c

File tree

6 files changed

+70
-29
lines changed

6 files changed

+70
-29
lines changed

packages/create-vite/CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## [7.1.0](https://github.com/vitejs/vite/compare/[email protected]@7.1.0) (2025-08-07)
2+
### Bug Fixes
3+
4+
* **deps:** update all non-major dependencies ([#20406](https://github.com/vitejs/vite/issues/20406)) ([1a1cc8a](https://github.com/vitejs/vite/commit/1a1cc8a435a21996255b3e5cc75ed4680de2a7f3))
5+
* **deps:** update all non-major dependencies ([#20442](https://github.com/vitejs/vite/issues/20442)) ([e49f505](https://github.com/vitejs/vite/commit/e49f50599d852eec644e79b074b4648e2dff1e5d))
6+
* **deps:** update all non-major dependencies ([#20489](https://github.com/vitejs/vite/issues/20489)) ([f6aa04a](https://github.com/vitejs/vite/commit/f6aa04a52d486c8881f666c450caa3dab3c6bba1))
7+
* **deps:** update all non-major dependencies ([#20537](https://github.com/vitejs/vite/issues/20537)) ([fc9a9d3](https://github.com/vitejs/vite/commit/fc9a9d3f1493caa3d614f64e0a61fd5684f0928b))
8+
9+
### Documentation
10+
11+
* tiny typo ([#20404](https://github.com/vitejs/vite/issues/20404)) ([3123eb7](https://github.com/vitejs/vite/commit/3123eb7071b7f89c7d0043030edc8eb5b3731680))
12+
13+
### Miscellaneous Chores
14+
15+
* **deps:** update dependency vue-tsc to v3 ([#20491](https://github.com/vitejs/vite/issues/20491)) ([51f512f](https://github.com/vitejs/vite/commit/51f512f12aae4b2905863d25b803c1f5d634ba03))
16+
* **deps:** update rolldown-related dependencies ([#20441](https://github.com/vitejs/vite/issues/20441)) ([f689d61](https://github.com/vitejs/vite/commit/f689d613429ae9452c74f8bc482d8cc2584ea6b8))
17+
* **deps:** update rolldown-related dependencies ([#20536](https://github.com/vitejs/vite/issues/20536)) ([8be2787](https://github.com/vitejs/vite/commit/8be278748a92b128c49a24619d8d537dd2b08ceb))
18+
119
## <small>[7.0.3](https://github.com/vitejs/vite/compare/[email protected]@7.0.3) (2025-07-11)</small>
220
### Features
321

packages/create-vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-vite",
3-
"version": "7.0.3",
3+
"version": "7.1.0",
44
"type": "module",
55
"license": "MIT",
66
"author": "Evan You",

packages/plugin-legacy/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## [7.2.0](https://github.com/vitejs/vite/compare/[email protected]@7.2.0) (2025-08-07)
2+
### Bug Fixes
3+
4+
* **deps:** update all non-major dependencies ([#20537](https://github.com/vitejs/vite/issues/20537)) ([fc9a9d3](https://github.com/vitejs/vite/commit/fc9a9d3f1493caa3d614f64e0a61fd5684f0928b))
5+
* **legacy:** `modernTargets` should set `build.target` ([#20393](https://github.com/vitejs/vite/issues/20393)) ([76c5e40](https://github.com/vitejs/vite/commit/76c5e40864f42bb33ee7ea9184e32d5156fa1a4a))
6+
7+
### Miscellaneous Chores
8+
9+
* **deps:** update rolldown-related dependencies ([#20441](https://github.com/vitejs/vite/issues/20441)) ([f689d61](https://github.com/vitejs/vite/commit/f689d613429ae9452c74f8bc482d8cc2584ea6b8))
10+
* **deps:** update rolldown-related dependencies ([#20536](https://github.com/vitejs/vite/issues/20536)) ([8be2787](https://github.com/vitejs/vite/commit/8be278748a92b128c49a24619d8d537dd2b08ceb))
11+
112
## [7.1.0](https://github.com/vitejs/vite/compare/[email protected]@7.1.0) (2025-07-22)
213
### Features
314

packages/plugin-legacy/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ npm add -D terser
4040
- **Type:** `string | string[] | { [key: string]: string }`
4141
- **Default:** [`'last 2 versions and not dead, > 0.3%, Firefox ESR'`](https://browsersl.ist/#q=last+2+versions+and+not+dead%2C+%3E+0.3%25%2C+Firefox+ESR)
4242

43-
If explicitly set, it's passed on to [`@babel/preset-env`](https://babeljs.io/docs/en/babel-preset-env#targets) when rendering **legacy chunks**.
43+
It's passed on to [`@babel/preset-env`](https://babeljs.io/docs/en/babel-preset-env#targets) when rendering **legacy chunks**.
4444

4545
The query is also [Browserslist compatible](https://github.com/browserslist/browserslist). See [Browserslist Best Practices](https://github.com/browserslist/browserslist#best-practices) for more details.
4646

@@ -51,12 +51,14 @@ npm add -D terser
5151
- **Type:** `string | string[]`
5252
- **Default:** [`'edge>=79, firefox>=67, chrome>=64, safari>=12, chromeAndroid>=64, iOS>=12'`](https://browsersl.ist/#q=edge%3E%3D79%2C+firefox%3E%3D67%2C+chrome%3E%3D64%2C+safari%3E%3D12%2C+chromeAndroid%3E%3D64%2C+iOS%3E%3D12)
5353

54-
If explicitly set, it's passed on to [`@babel/preset-env`](https://babeljs.io/docs/en/babel-preset-env#targets) when rendering **modern chunks**.
54+
It's passed on to [`@babel/preset-env`](https://babeljs.io/docs/en/babel-preset-env#targets) when collecting polyfills for **modern chunks**. The value set here will override the `build.target` option.
5555

5656
The query is also [Browserslist compatible](https://github.com/browserslist/browserslist). See [Browserslist Best Practices](https://github.com/browserslist/browserslist#best-practices) for more details.
5757

5858
If it's not set, plugin-legacy will fallback to the default value.
5959

60+
Note that this options should not be set unless `renderLegacyChunks` is set to `false`.
61+
6062
### `polyfills`
6163

6264
- **Type:** `boolean | string[]`

packages/plugin-legacy/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@vitejs/plugin-legacy",
3-
"version": "7.1.0",
3+
"version": "7.2.0",
44
"type": "module",
55
"license": "MIT",
66
"author": "Evan You",

packages/plugin-legacy/src/index.ts

Lines changed: 35 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,20 @@ const _require = createRequire(import.meta.url)
125125
const nonLeadingHashInFileNameRE = /[^/]+\[hash(?::\d+)?\]/
126126
const prefixedHashInFileNameRE = /\W?\[hash(?::\d+)?\]/
127127

128+
// browsers supporting ESM + dynamic import + import.meta + async generator
129+
const modernTargetsEsbuild = [
130+
'es2020',
131+
'edge79',
132+
'firefox67',
133+
'chrome64',
134+
'safari12',
135+
]
136+
// same with above but by browserslist syntax
137+
// es2020 = chrome 80+, safari 13.1+, firefox 72+, edge 80+
138+
// https://github.com/evanw/esbuild/issues/121#issuecomment-646956379
139+
const modernTargetsBabel =
140+
'edge>=79, firefox>=67, chrome>=64, safari>=12, chromeAndroid>=64, iOS>=12'
141+
128142
const outputOptionsForLegacyChunks =
129143
new WeakSet<Rollup.NormalizedOutputOptions>()
130144

@@ -138,21 +152,8 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
138152

139153
let config: ResolvedConfig
140154
let targets: Options['targets']
141-
let modernTargets: Options['modernTargets']
142-
143-
// browsers supporting ESM + dynamic import + import.meta + async generator
144-
const modernTargetsEsbuild = [
145-
'es2020',
146-
'edge79',
147-
'firefox67',
148-
'chrome64',
149-
'safari12',
150-
]
151-
// same with above but by browserslist syntax
152-
// es2020 = chrome 80+, safari 13.1+, firefox 72+, edge 80+
153-
// https://github.com/evanw/esbuild/issues/121#issuecomment-646956379
154-
const modernTargetsBabel =
155-
'edge>=79, firefox>=67, chrome>=64, safari>=12, chromeAndroid>=64, iOS>=12'
155+
const modernTargets: Options['modernTargets'] =
156+
options.modernTargets || modernTargetsBabel
156157

157158
const genLegacy = options.renderLegacyChunks !== false
158159
const genModern = options.renderModernChunks !== false
@@ -210,6 +211,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
210211
}
211212

212213
let overriddenBuildTarget = false
214+
let overriddenBuildTargetOnlyModern = false
213215
let overriddenDefaultModernTargets = false
214216
const legacyConfigPlugin: Plugin = {
215217
name: 'vite:legacy-config',
@@ -234,16 +236,18 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
234236
// See https://github.com/vitejs/vite/pull/10052#issuecomment-1242076461
235237
overriddenBuildTarget = config.build.target !== undefined
236238
overriddenDefaultModernTargets = options.modernTargets !== undefined
239+
} else {
240+
overriddenBuildTargetOnlyModern = config.build.target !== undefined
241+
}
237242

238-
if (options.modernTargets) {
239-
// Package is ESM only
240-
const { default: browserslistToEsbuild } = await import(
241-
'browserslist-to-esbuild'
242-
)
243-
config.build.target = browserslistToEsbuild(options.modernTargets)
244-
} else {
245-
config.build.target = modernTargetsEsbuild
246-
}
243+
if (options.modernTargets) {
244+
// Package is ESM only
245+
const { default: browserslistToEsbuild } = await import(
246+
'browserslist-to-esbuild'
247+
)
248+
config.build.target = browserslistToEsbuild(options.modernTargets)
249+
} else {
250+
config.build.target = modernTargetsEsbuild
247251
}
248252
}
249253

@@ -264,6 +268,13 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
264268
),
265269
)
266270
}
271+
if (overriddenBuildTargetOnlyModern) {
272+
config.logger.warn(
273+
colors.yellow(
274+
`plugin-legacy overrode 'build.target'. You should pass 'modernTargets' as an option to this plugin with the list of browsers to support instead.`,
275+
),
276+
)
277+
}
267278
if (overriddenDefaultModernTargets) {
268279
config.logger.warn(
269280
colors.yellow(
@@ -389,7 +400,6 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
389400
}
390401
config = _config
391402

392-
modernTargets = options.modernTargets || modernTargetsBabel
393403
if (isDebug) {
394404
console.log(`[@vitejs/plugin-legacy] modernTargets:`, modernTargets)
395405
}

0 commit comments

Comments
 (0)