From 79cdc43699eb73f89d10faf1a7452f376837242d Mon Sep 17 00:00:00 2001 From: Steve Repsher Date: Mon, 6 May 2024 18:06:21 -0400 Subject: [PATCH] Enhance webpack transform async plugin to use babel runtime (with fix) (#20745) --- build-scripts/webpack.cjs | 6 +++++- package.json | 2 +- yarn.lock | 10 +++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/build-scripts/webpack.cjs b/build-scripts/webpack.cjs index b08d3b2eeb50..0679e3e2baec 100644 --- a/build-scripts/webpack.cjs +++ b/build-scripts/webpack.cjs @@ -10,6 +10,7 @@ const WebpackBar = require("webpackbar"); const { TransformAsyncModulesPlugin, } = require("transform-async-modules-webpack-plugin"); +const { dependencies } = require("../package.json"); const paths = require("./paths.cjs"); const bundle = require("./bundle.cjs"); @@ -156,7 +157,10 @@ const createWebpackConfig = ({ transform: (stats) => JSON.stringify(filterStats(stats)), }), !latestBuild && - new TransformAsyncModulesPlugin({ browserslistEnv: "legacy" }), + new TransformAsyncModulesPlugin({ + browserslistEnv: "legacy", + runtime: { version: dependencies["@babel/runtime"] }, + }), ].filter(Boolean), resolve: { extensions: [".ts", ".js", ".json"], diff --git a/package.json b/package.json index 542c74ab36d9..367cd54298fc 100644 --- a/package.json +++ b/package.json @@ -237,7 +237,7 @@ "systemjs": "6.15.1", "tar": "7.0.1", "terser-webpack-plugin": "5.3.10", - "transform-async-modules-webpack-plugin": "1.1.0", + "transform-async-modules-webpack-plugin": "1.1.1", "ts-lit-plugin": "2.0.2", "typescript": "5.4.5", "webpack": "5.91.0", diff --git a/yarn.lock b/yarn.lock index 56bef135f3c2..391f1ecbfe04 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9107,7 +9107,7 @@ __metadata: tar: "npm:7.0.1" terser-webpack-plugin: "npm:5.3.10" tinykeys: "npm:2.1.0" - transform-async-modules-webpack-plugin: "npm:1.1.0" + transform-async-modules-webpack-plugin: "npm:1.1.1" ts-lit-plugin: "npm:2.0.2" tsparticles-engine: "npm:2.12.0" tsparticles-preset-links: "npm:2.12.0" @@ -13922,9 +13922,9 @@ __metadata: languageName: node linkType: hard -"transform-async-modules-webpack-plugin@npm:1.1.0": - version: 1.1.0 - resolution: "transform-async-modules-webpack-plugin@npm:1.1.0" +"transform-async-modules-webpack-plugin@npm:1.1.1": + version: 1.1.1 + resolution: "transform-async-modules-webpack-plugin@npm:1.1.1" dependencies: "@babel/core": "npm:^7.13.0" "@babel/plugin-transform-runtime": "npm:^7.13.0" @@ -13935,7 +13935,7 @@ __metadata: "@babel/preset-env": ^7.13.0 "@babel/runtime": ^7.13.0 webpack: ^5.0.0 - checksum: 10/35e729c8ed44bf7cf5b6ae6e4ea5eb82eef44038ec13fba0a53eec551095be5553e3c99c6c7dec37d6b1fd3c9e04f35e94a246f735c81fb2d247dfad21678322 + checksum: 10/dbae9102100519ac124a55068e9de8096a2cb94153bce58b3b3ed64482f88c24430b7daa8397b32685e080a5c61da8aacabc3431400fc620323c7eeffa2bbab5 languageName: node linkType: hard