From e2b12901039ea12c95b3316d9a09f74f72d84dda Mon Sep 17 00:00:00 2001 From: Andy Joslin Date: Mon, 24 Mar 2014 16:08:47 -0600 Subject: [PATCH] chore(build): add closure around whole file --- config/build.config.js | 5 +++-- gulpfile.js | 5 +++++ package.json | 3 ++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/config/build.config.js b/config/build.config.js index dd17dab66dc..ec1322e3f7a 100644 --- a/config/build.config.js +++ b/config/build.config.js @@ -16,14 +16,15 @@ module.exports = { ' *\n' + ' * Licensed under the MIT license. Please see LICENSE for more information.\n'+ ' *\n' + - ' */\n\n' , + ' */\n\n', bundleBanner: '/*!\n' + ' * ionic.bundle.js is a concatenation of:\n' + ' * ionic.js, angular.js, angular-animate.js,\n'+ ' * angular-ui-router.js, and ionic-angular.js\n'+ ' */\n\n', - footer: '\n})();', + closureStart: '(function() {\n', + closureEnd: '\n})();', ionicFiles: [ // Base diff --git a/gulpfile.js b/gulpfile.js index a0f5ee98b57..9a3f6784a02 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -21,6 +21,7 @@ var through = require('through'); var argv = require('minimist')(process.argv.slice(2)); var concat = require('gulp-concat'); +var footer = require('gulp-footer'); var gulpif = require('gulp-if'); var header = require('gulp-header'); var jshint = require('gulp-jshint'); @@ -185,6 +186,8 @@ gulp.task('scripts', function() { .pipe(gulpif(IS_RELEASE_BUILD, stripDebug())) .pipe(template({ pkg: pkg })) .pipe(concat('ionic.js')) + .pipe(header(buildConfig.closureStart)) + .pipe(footer(buildConfig.closureEnd)) .pipe(header(banner)) .pipe(gulp.dest(buildConfig.distJs)) .pipe(gulpif(IS_RELEASE_BUILD, uglify())) @@ -197,6 +200,8 @@ gulp.task('scripts-ng', function() { return gulp.src(buildConfig.angularIonicFiles) .pipe(gulpif(IS_RELEASE_BUILD, stripDebug())) .pipe(concat('ionic-angular.js')) + .pipe(header(buildConfig.closureStart)) + .pipe(footer(buildConfig.closureEnd)) .pipe(header(banner)) .pipe(gulp.dest(buildConfig.distJs)) .pipe(gulpif(IS_RELEASE_BUILD, uglify())) diff --git a/package.json b/package.json index b6f0bad2d3e..5d8a030444f 100644 --- a/package.json +++ b/package.json @@ -43,7 +43,8 @@ "htmlparser2": "3.7.0", "js-yaml": "3.0.2", "event-stream": "3.1.0", - "gulp-strip-debug": "^0.3.0" + "gulp-strip-debug": "^0.3.0", + "gulp-footer": "^1.0.4" }, "licenses": [ {