chore(build): add closure around whole file

This commit is contained in:
Andy Joslin
2014-03-24 16:08:47 -06:00
parent 7af2bb50e1
commit e2b1290103
3 changed files with 10 additions and 3 deletions

View File

@@ -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

View File

@@ -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()))

View File

@@ -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": [
{