From 11c96a66e44c4c4794cd21ae99baa781eda96803 Mon Sep 17 00:00:00 2001 From: Andy Joslin Date: Wed, 19 Mar 2014 16:42:22 -0600 Subject: [PATCH] chore(build): add version name to window.ionic --- gulpfile.js | 10 +++++++--- js/ionic.js | 2 +- package.json | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index d58b25b84b4..0c0f46c125e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -51,7 +51,7 @@ gulp.task('docs-index', function() { this.field('path'); this.field('title', {boost: 10}); this.field('body'); - this.ref('path') + this.ref('path'); }); var ref = {}; @@ -100,7 +100,10 @@ gulp.task('docs-index', function() { })).on('end', function() { // Write out as one json file mkdirp.sync('tmp/ionic-site/data'); - fs.writeFileSync('tmp/ionic-site/data/index.json', JSON.stringify({'ref': ref, 'index': idx.toJSON()})); + fs.writeFileSync( + 'tmp/ionic-site/data/index.json', + JSON.stringify({'ref': ref, 'index': idx.toJSON()}) + ); }); }); @@ -180,6 +183,7 @@ gulp.task('vendor', function() { gulp.task('scripts', function() { return gulp.src(buildConfig.ionicFiles) .pipe(gulpif(IS_RELEASE_BUILD, stripDebug())) + .pipe(template({ pkg: pkg })) .pipe(concat('ionic.js')) .pipe(header(banner)) .pipe(gulp.dest(buildConfig.distJs)) @@ -191,7 +195,7 @@ gulp.task('scripts', function() { gulp.task('scripts-ng', function() { return gulp.src(buildConfig.angularIonicFiles) - // .pipe(gulpif(IS_RELEASE_BUILD, stripDebug())) + .pipe(gulpif(IS_RELEASE_BUILD, stripDebug())) .pipe(concat('ionic-angular.js')) .pipe(header(banner)) .pipe(gulp.dest(buildConfig.distJs)) diff --git a/js/ionic.js b/js/ionic.js index 29265ca87fd..5266e3ed46a 100644 --- a/js/ionic.js +++ b/js/ionic.js @@ -4,5 +4,5 @@ window.ionic = { controllers: {}, views: {}, - version: '{{ VERSION }}' + version: '<%= pkg.version %>' }; diff --git a/package.json b/package.json index 52ca56694db..b6f0bad2d3e 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,6 @@ "gulp-template": "^0.1.1", "gulp-concat": "^2.1.7", "gulp-jshint": "^1.5.0", - "gulp-strip-debug": "0.2.0", "gulp-sass": "^0.7.1", "gulp-util": "^2.2.14", "gulp-uglify": "^0.2.1", @@ -43,7 +42,8 @@ "lunr": "0.4.5", "htmlparser2": "3.7.0", "js-yaml": "3.0.2", - "event-stream": "3.1.0" + "event-stream": "3.1.0", + "gulp-strip-debug": "^0.3.0" }, "licenses": [ {