Skip to content

Commit

Permalink
fix(legacy): import @babel/preset-env (#12961)
Browse files Browse the repository at this point in the history
  • Loading branch information
merceyz authored May 2, 2023
1 parent 5890aa9 commit d53c650
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
"@microsoft/api-extractor": "^7.34.4",
"@rollup/plugin-typescript": "^11.1.0",
"@types/babel__core": "^7.20.0",
"@types/babel__preset-env": "^7.9.2",
"@types/babel__standalone": "^7.1.4",
"@types/convert-source-map": "^2.0.0",
"@types/cross-spawn": "^6.0.2",
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 @@ -438,7 +438,7 @@ function viteLegacyPlugin(options: Options = {}): Plugin[] {
}),
],
[
'@babel/preset-env',
(await import('@babel/preset-env')).default,
createBabelPresetEnvOptions(targets, {
needPolyfills,
ignoreBrowserslistConfig: options.ignoreBrowserslistConfig,
Expand Down Expand Up @@ -608,7 +608,7 @@ export async function detectPolyfills(
configFile: false,
presets: [
[
'@babel/preset-env',
(await import('@babel/preset-env')).default,
createBabelPresetEnvOptions(targets, {
ignoreBrowserslistConfig: true,
}),
Expand Down
7 changes: 7 additions & 0 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 d53c650

Please sign in to comment.