diff --git a/packages/plugin-legacy/package.json b/packages/plugin-legacy/package.json index 028a6b67a2fe35..267d339b9a88a9 100644 --- a/packages/plugin-legacy/package.json +++ b/packages/plugin-legacy/package.json @@ -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" diff --git a/packages/plugin-legacy/src/index.ts b/packages/plugin-legacy/src/index.ts index d7f0bb206547aa..13d725cff05eef 100644 --- a/packages/plugin-legacy/src/index.ts +++ b/packages/plugin-legacy/src/index.ts @@ -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, @@ -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 } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0bec01c01c3507..1dea46182b28cc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -204,12 +204,12 @@ importers: browserslist: specifier: ^4.23.0 version: 4.23.0 + browserslist-to-esbuild: + specifier: ^2.1.1 + version: 2.1.1(browserslist@4.23.0) core-js: specifier: ^3.36.0 version: 3.36.0 - esbuild-plugin-browserslist: - specifier: ^0.11.1 - version: 0.11.1(browserslist@4.23.0) magic-string: specifier: ^0.30.7 version: 0.30.7 @@ -2976,6 +2976,7 @@ packages: cpu: [arm64] os: [android] requiresBuild: true + dev: false optional: true /@esbuild/android-arm@0.18.20: @@ -3002,6 +3003,7 @@ packages: cpu: [arm] os: [android] requiresBuild: true + dev: false optional: true /@esbuild/android-x64@0.18.20: @@ -3028,6 +3030,7 @@ packages: cpu: [x64] os: [android] requiresBuild: true + dev: false optional: true /@esbuild/darwin-arm64@0.18.20: @@ -3054,6 +3057,7 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true + dev: false optional: true /@esbuild/darwin-x64@0.18.20: @@ -3080,6 +3084,7 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true + dev: false optional: true /@esbuild/freebsd-arm64@0.18.20: @@ -3106,6 +3111,7 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true + dev: false optional: true /@esbuild/freebsd-x64@0.18.20: @@ -3132,6 +3138,7 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true + dev: false optional: true /@esbuild/linux-arm64@0.18.20: @@ -3158,6 +3165,7 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-arm@0.18.20: @@ -3184,6 +3192,7 @@ packages: cpu: [arm] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-ia32@0.18.20: @@ -3210,6 +3219,7 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-loong64@0.18.20: @@ -3236,6 +3246,7 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-mips64el@0.18.20: @@ -3262,6 +3273,7 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-ppc64@0.18.20: @@ -3288,6 +3300,7 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-riscv64@0.18.20: @@ -3314,6 +3327,7 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-s390x@0.18.20: @@ -3340,6 +3354,7 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/linux-x64@0.18.20: @@ -3366,6 +3381,7 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: false optional: true /@esbuild/netbsd-x64@0.18.20: @@ -3392,6 +3408,7 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true + dev: false optional: true /@esbuild/openbsd-x64@0.18.20: @@ -3418,6 +3435,7 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true + dev: false optional: true /@esbuild/sunos-x64@0.18.20: @@ -3444,6 +3462,7 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true + dev: false optional: true /@esbuild/win32-arm64@0.18.20: @@ -3470,6 +3489,7 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true + dev: false optional: true /@esbuild/win32-ia32@0.18.20: @@ -3496,6 +3516,7 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true + dev: false optional: true /@esbuild/win32-x64@0.18.20: @@ -3522,6 +3543,7 @@ packages: cpu: [x64] os: [win32] requiresBuild: true + dev: false optional: true /@eslint-community/eslint-utils@4.4.0(eslint@8.56.0): @@ -4977,6 +4999,17 @@ packages: dependencies: fill-range: 7.0.1 + /browserslist-to-esbuild@2.1.1(browserslist@4.23.0): + resolution: {integrity: sha512-KN+mty6C3e9AN8Z5dI1xeN15ExcRNeISoC3g7V0Kax/MMF9MSoYA2G7lkTTcVUFntiEjkpI0HNgqJC1NjdyNUw==} + engines: {node: '>=18'} + hasBin: true + peerDependencies: + browserslist: '*' + dependencies: + browserslist: 4.23.0 + meow: 13.2.0 + dev: false + /browserslist@4.23.0: resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -5682,20 +5715,6 @@ packages: ext: 1.6.0 dev: false - /esbuild-plugin-browserslist@0.11.1(browserslist@4.23.0): - resolution: {integrity: sha512-yNdZRdDBEbm0PT4q2bJBhXvnwakXG5mG8ipiwGe5SRDPnKa7L7kQm2tHuBMowBtcFz6kRtZTv5njK7PJwU+tCQ==} - engines: {node: '>=18'} - peerDependencies: - browserslist: ^4.21.8 - esbuild: ~0.20.0 - dependencies: - browserslist: 4.23.0 - debug: 4.3.4 - zod: 3.21.4 - transitivePeerDependencies: - - supports-color - dev: false - /esbuild@0.18.20: resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} engines: {node: '>=12'} @@ -5785,6 +5804,7 @@ packages: '@esbuild/win32-arm64': 0.19.3 '@esbuild/win32-ia32': 0.19.3 '@esbuild/win32-x64': 0.19.3 + dev: false /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} @@ -7258,6 +7278,11 @@ packages: engines: {node: '>=16.10'} dev: true + /meow@13.2.0: + resolution: {integrity: sha512-pxQJQzB6djGPXh08dacEloMFopsOqGVRKFPYvPOt9XDZ1HasbgDZA74CJGreSU4G3Ak7EFJGoiH2auq+yXISgA==} + engines: {node: '>=18'} + dev: false + /merge-descriptors@1.0.1: resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} @@ -9228,7 +9253,7 @@ packages: citty: 0.1.4 consola: 3.2.3 defu: 6.1.2 - esbuild: 0.19.3 + esbuild: 0.19.11 globby: 13.2.2 hookable: 5.5.3 jiti: 1.20.0 @@ -9676,6 +9701,7 @@ packages: /zod@3.21.4: resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==} + dev: true file:playground/alias/dir/module: resolution: {directory: playground/alias/dir/module, type: directory}