Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(plugin-legacy): replace esbuild-plugin-browserslist with browserslist-to-esbuild #15988

Merged
merged 2 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.