Skip to content

Commit

Permalink
fix(plugin-legacy): replace esbuild-plugin-browserslist with `brows…
Browse files Browse the repository at this point in the history
…erslist-to-esbuild` (#15988)
  • Loading branch information
btea authored Feb 21, 2024
1 parent 4144781 commit 37af8a7
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-legacy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
"@babel/core": "^7.23.9",
"@babel/preset-env": "^7.23.9",
"browserslist": "^4.23.0",
"browserslist-to-esbuild": "^2.1.1",
"core-js": "^3.36.0",
"esbuild-plugin-browserslist": "^0.11.1",
"magic-string": "^0.30.7",
"regenerator-runtime": "^0.14.1",
"systemjs": "^6.14.3"
Expand Down
4 changes: 2 additions & 2 deletions packages/plugin-legacy/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import type {
} from '@babel/core'
import colors from 'picocolors'
import browserslist from 'browserslist'
import { resolveToEsbuildTarget } from 'esbuild-plugin-browserslist'
import browserslistToEsbuild from 'browserslist-to-esbuild'
import type { Options } from './types'
import {
detectModernBrowserCode,
Expand Down Expand Up @@ -210,7 +210,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
overriddenBuildTarget = config.build.target !== undefined
overriddenDefaultModernTargets = options.modernTargets !== undefined
config.build.target = options.modernTargets
? resolveToEsbuildTarget(browserslist(options.modernTargets))
? browserslistToEsbuild(options.modernTargets)
: modernTargetsEsbuild
}
}
Expand Down
62 changes: 44 additions & 18 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 37af8a7

Please sign in to comment.