diff --git a/build-scripts/webpack.cjs b/build-scripts/webpack.cjs index 0e6cee3a8e54..e1047cadd4ba 100644 --- a/build-scripts/webpack.cjs +++ b/build-scripts/webpack.cjs @@ -7,6 +7,9 @@ const TerserPlugin = require("terser-webpack-plugin"); const { WebpackManifestPlugin } = require("webpack-manifest-plugin"); const log = require("fancy-log"); const WebpackBar = require("webpackbar"); +const { + TransformAsyncModulesPlugin, +} = require("transform-async-modules-webpack-plugin"); const paths = require("./paths.cjs"); const bundle = require("./bundle.cjs"); @@ -152,6 +155,8 @@ const createWebpackConfig = ({ stats: { assets: true, chunks: true, modules: true }, transform: (stats) => JSON.stringify(filterStats(stats)), }), + !latestBuild && + new TransformAsyncModulesPlugin({ browserslistEnv: "legacy" }), ].filter(Boolean), resolve: { extensions: [".ts", ".js", ".json"], diff --git a/package.json b/package.json index a66ec2870b52..69deda098d31 100644 --- a/package.json +++ b/package.json @@ -236,6 +236,7 @@ "systemjs": "6.14.2", "tar": "6.2.0", "terser-webpack-plugin": "5.3.9", + "transform-async-modules-webpack-plugin": "1.0.2", "ts-lit-plugin": "2.0.1", "typescript": "5.3.3", "vinyl-buffer": "1.0.1", diff --git a/yarn.lock b/yarn.lock index 313883fac92f..e89b618d9b60 100644 --- a/yarn.lock +++ b/yarn.lock @@ -62,7 +62,7 @@ __metadata: languageName: node linkType: hard -"@babel/core@npm:7.23.6, @babel/core@npm:^7.11.1, @babel/core@npm:^7.12.3": +"@babel/core@npm:7.23.6, @babel/core@npm:^7.0.0, @babel/core@npm:^7.11.1, @babel/core@npm:^7.12.3": version: 7.23.6 resolution: "@babel/core@npm:7.23.6" dependencies: @@ -1270,7 +1270,7 @@ __metadata: languageName: node linkType: hard -"@babel/preset-env@npm:7.23.6, @babel/preset-env@npm:^7.11.0": +"@babel/preset-env@npm:7.23.6, @babel/preset-env@npm:^7.0.0, @babel/preset-env@npm:^7.11.0": version: 7.23.6 resolution: "@babel/preset-env@npm:7.23.6" dependencies: @@ -9713,6 +9713,7 @@ __metadata: tar: "npm:6.2.0" terser-webpack-plugin: "npm:5.3.9" tinykeys: "npm:2.1.0" + transform-async-modules-webpack-plugin: "npm:1.0.2" ts-lit-plugin: "npm:2.0.1" tsparticles-engine: "npm:2.12.0" tsparticles-preset-links: "npm:2.12.0" @@ -15249,6 +15250,18 @@ __metadata: languageName: node linkType: hard +"transform-async-modules-webpack-plugin@npm:1.0.2": + version: 1.0.2 + resolution: "transform-async-modules-webpack-plugin@npm:1.0.2" + dependencies: + "@babel/core": "npm:^7.0.0" + "@babel/preset-env": "npm:^7.0.0" + peerDependencies: + webpack: ^5.0.0 + checksum: 645df77c31e42f8ae57d86dfa023f67e4a3854f3b0848a9fd28392cb83d91fc05762150b909d01ad570e867b9e16e7e49c88a183d2dc7911d0e0154aaac21d52 + languageName: node + linkType: hard + "ts-api-utils@npm:^1.0.1": version: 1.0.3 resolution: "ts-api-utils@npm:1.0.3"