mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(build): add closure around whole file
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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()))
|
||||
|
||||
@@ -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": [
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user