Skip to content

Commit

Permalink
Enhance webpack transform async plugin to use babel runtime (with fix) (
Browse files Browse the repository at this point in the history
  • Loading branch information
steverep authored May 6, 2024
1 parent 8ff9823 commit 79cdc43
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
6 changes: 5 additions & 1 deletion build-scripts/webpack.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down Expand Up @@ -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"],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand All @@ -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

Expand Down

0 comments on commit 79cdc43

Please sign in to comment.