Skip to content

Commit

Permalink
fix(plugin-legacy): respect modernTargets option if renderLegacyChunk…
Browse files Browse the repository at this point in the history
…s disabled (#15789)
  • Loading branch information
jgosmann committed Mar 8, 2024
1 parent 0d2df52 commit 0813531
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/plugin-legacy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,10 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
}
config = _config

modernTargets = options.modernTargets || modernTargetsBabel
isDebug &&
console.log(`[@vitejs/plugin-legacy] modernTargets:`, modernTargets)

if (!genLegacy || config.build.ssr) {
return
}
Expand All @@ -341,10 +345,6 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
'last 2 versions and not dead, > 0.3%, Firefox ESR'
isDebug && console.log(`[@vitejs/plugin-legacy] targets:`, targets)

modernTargets = options.modernTargets || modernTargetsBabel
isDebug &&
console.log(`[@vitejs/plugin-legacy] modernTargets:`, modernTargets)

const getLegacyOutputFileName = (
fileNames:
| string
Expand Down

0 comments on commit 0813531

Please sign in to comment.