From 83703bca17fd18b9ac700fae4801d87a4d86961d Mon Sep 17 00:00:00 2001 From: stopcoder Date: Thu, 21 Jun 2018 21:31:58 +0200 Subject: [PATCH] [FIX] Use the target bundle format to decide decoration (#24) - To judge whether a module should be decorated or not depends on the currently being used bundle format. Therefore the target bundle format should be used instead of checking whether the global module is inside the resolved modules --- lib/lbt/bundle/Builder.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/lbt/bundle/Builder.js b/lib/lbt/bundle/Builder.js index 82318bf53..a24d0b0c6 100644 --- a/lib/lbt/bundle/Builder.js +++ b/lib/lbt/bundle/Builder.js @@ -136,7 +136,8 @@ class BundleBuilder { // when decorateBootstrapModule is set to false, we don't write the optimized flag // and don't write the try catch wrapper this.shouldDecorate = this.options.decorateBootstrapModule && - (((this.optimizedSources && !this.options.debugMode) || this.optimize) && resolvedModule.containsGlobal); + (((this.optimizedSources && !this.options.debugMode) || this.optimize) && + this.targetBundleFormat.shouldDecorate(resolvedModule)); // TODO is the following condition ok or should the availability of jquery.sap.global.js be configurable? this.jqglobalAvailable = !resolvedModule.containsGlobal; this.openModule(resolvedModule.name);