Skip to content

Commit

Permalink
chore(build): add closure around whole file
Browse files Browse the repository at this point in the history
  • Loading branch information
ajoslin committed Mar 24, 2014
1 parent 7af2bb5 commit e2b1290
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions config/build.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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()))
Expand All @@ -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()))
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
{
Expand Down

0 comments on commit e2b1290

Please sign in to comment.