diff --git a/packages/metal-soy-bundle/gulpfile.js b/packages/metal-soy-bundle/gulpfile.js index c48d87c3..51b08c1a 100644 --- a/packages/metal-soy-bundle/gulpfile.js +++ b/packages/metal-soy-bundle/gulpfile.js @@ -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' +