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] 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, ),