From 8a0a25a9eec6e20dfbcd4bb003b856fc55859803 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Ribaudo?= Date: Tue, 29 Oct 2019 12:49:12 +0100 Subject: [PATCH 1/2] Add supportsTopLevelAwait to caller --- src/injectCaller.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/injectCaller.js b/src/injectCaller.js index f35903b9..5e1f6f52 100644 --- a/src/injectCaller.js +++ b/src/injectCaller.js @@ -11,6 +11,11 @@ module.exports = function injectCaller(opts) { // Webpack >= 2 supports ESM and dynamic import. supportsStaticESM: true, supportsDynamicImport: true, + + // Webpack 5 supports TLA behind a flag. We enable it by default + // for Babel, and then webpack will throw an error is the experimental + // flag isn't enabled. + supportsTopLevelAwait: true, }, opts.caller, ), From 1c357310e69b75ee087689536664dcc3ccdfc066 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hu=C3=A1ng=20J=C3=B9nli=C3=A0ng?= Date: Fri, 21 Feb 2020 11:28:44 -0500 Subject: [PATCH 2/2] Update src/injectCaller.js --- src/injectCaller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/injectCaller.js b/src/injectCaller.js index 5e1f6f52..9ee10e03 100644 --- a/src/injectCaller.js +++ b/src/injectCaller.js @@ -13,7 +13,7 @@ module.exports = function injectCaller(opts) { supportsDynamicImport: true, // Webpack 5 supports TLA behind a flag. We enable it by default - // for Babel, and then webpack will throw an error is the experimental + // for Babel, and then webpack will throw an error if the experimental // flag isn't enabled. supportsTopLevelAwait: true, },