Skip to content

Commit

Permalink
Check to see if bundle has been loaded already
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Frampton authored and Robert-Frampton committed Oct 9, 2017
1 parent 8fe3762 commit eeb36e0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/metal-soy-bundle/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ gulp.task('build', function() {
return gulp.src(dependencies)
.pipe(concat('bundle.js'))
.pipe(replace('var goog = goog || {};', 'var goog = this.goog || {};'))
.pipe(header('import \'metal-incremental-dom\';\n\n(function() {\nthis.CLOSURE_NO_DEPS = true;\nthis.goog = this.goog || {};\n\n'))
.pipe(header('import \'metal-incremental-dom\';\n\n(function() {\nthis.CLOSURE_NO_DEPS = true;\nthis.goog = this.goog || {};\n\n' +
'if (this.__METAL_SOY_BUNDLE_LOADED__) {\n' +
' return;\n' +
'}\n' + 'this.__METAL_SOY_BUNDLE_LOADED__ = true;\n\n'))
.pipe(footer('\n\ngoog.loadModule(function() {\n' +
' goog.module(\'incrementaldom\');\n' +
' return IncrementalDOM;\n' +
Expand Down

0 comments on commit eeb36e0

Please sign in to comment.