Skip to content

Commit 0813531

Browse files
authoredMar 8, 2024··
fix(plugin-legacy): respect modernTargets option if renderLegacyChunks disabled (#15789)
1 parent 0d2df52 commit 0813531

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎packages/plugin-legacy/src/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,10 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
331331
}
332332
config = _config
333333

334+
modernTargets = options.modernTargets || modernTargetsBabel
335+
isDebug &&
336+
console.log(`[@vitejs/plugin-legacy] modernTargets:`, modernTargets)
337+
334338
if (!genLegacy || config.build.ssr) {
335339
return
336340
}
@@ -341,10 +345,6 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
341345
'last 2 versions and not dead, > 0.3%, Firefox ESR'
342346
isDebug && console.log(`[@vitejs/plugin-legacy] targets:`, targets)
343347

344-
modernTargets = options.modernTargets || modernTargetsBabel
345-
isDebug &&
346-
console.log(`[@vitejs/plugin-legacy] modernTargets:`, modernTargets)
347-
348348
const getLegacyOutputFileName = (
349349
fileNames:
350350
| string

0 commit comments

Comments
 (0)
Please sign in to comment.