Skip to content

Commit

Permalink
[FIX] Use the target bundle format to decide decoration (#24)
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
stopcoder authored Jun 21, 2018
1 parent 4b74ec5 commit 83703bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/lbt/bundle/Builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 83703bc

Please sign in to comment.