fix(build): Minify files for angular2.min.js bundle

Uglify files related to angular2.min.js bundle in one task.

Include reflect.js in the bundle, which was previously missing. Minify reflect.js, zone.js, and angular2.min.js using uglify.
This commit is contained in:
Daria Jung 2015-06-08 17:15:40 -07:00 committed by Rado Kirov
parent 591f742d42
commit 76797dfbd4
4 changed files with 526 additions and 5 deletions

View File

@ -34,6 +34,7 @@ var util = require('./tools/build/util');
var bundler = require('./tools/build/bundle');
var replace = require('gulp-replace');
var insert = require('gulp-insert');
var uglify = require('gulp-uglify');
var shouldLog = require('./tools/build/logging');
require('./tools/check-environment')({
@ -721,7 +722,6 @@ gulp.task('bundle.js.prod', ['build.js.prod'], function() {
});
// minified production build
// TODO: minify zone.js
gulp.task('bundle.js.min', ['build.js.prod'], function() {
return bundler.bundle(
bundleConfig,
@ -781,16 +781,20 @@ gulp.task('bundle.js.sfx.dev', ['build.js.dev'], function() {
gulp.task('bundle.js.prod.deps', ['bundle.js.prod'], function() {
return bundler.modify(
['node_modules/zone.js/dist/zone-microtask.js', 'dist/build/angular2.js'],
['node_modules/zone.js/dist/zone-microtask.js', 'node_modules/reflect-metadata/Reflect.js',
'dist/build/angular2.js'],
'angular2.js'
).pipe(gulp.dest('dist/bundle'));
});
gulp.task('bundle.js.min.deps', ['bundle.js.min'], function() {
gulp.task('bundle.js.min.deps', ['bundle.js.min'], function() {
return bundler.modify(
['node_modules/zone.js/dist/zone-microtask.js', 'dist/build/angular2.min.js'],
['node_modules/zone.js/dist/zone-microtask.min.js',
'node_modules/reflect-metadata/Reflect.js', 'dist/build/angular2.min.js'],
'angular2.min.js'
).pipe(gulp.dest('dist/bundle'));
)
.pipe(uglify())
.pipe(gulp.dest('dist/bundle'));
});
var JS_DEV_DEPS = [

View File

@ -6340,6 +6340,208 @@
}
}
},
"gulp-uglify": {
"version": "1.2.0",
"dependencies": {
"deap": {
"version": "1.0.0"
},
"gulp-util": {
"version": "3.0.5",
"dependencies": {
"array-differ": {
"version": "1.0.0"
},
"array-uniq": {
"version": "1.0.2"
},
"beeper": {
"version": "1.1.0"
},
"chalk": {
"version": "1.0.0",
"dependencies": {
"ansi-styles": {
"version": "2.0.1"
},
"escape-string-regexp": {
"version": "1.0.3"
},
"has-ansi": {
"version": "1.0.3",
"dependencies": {
"ansi-regex": {
"version": "1.1.1"
},
"get-stdin": {
"version": "4.0.1"
}
}
},
"supports-color": {
"version": "1.3.1"
}
}
},
"dateformat": {
"version": "1.0.11",
"dependencies": {
"get-stdin": {
"version": "4.0.1"
},
"meow": {
"version": "3.1.0",
"dependencies": {
"camelcase-keys": {
"version": "1.0.0",
"dependencies": {
"camelcase": {
"version": "1.1.0"
},
"map-obj": {
"version": "1.0.1"
}
}
}
}
}
}
},
"lodash._reescape": {
"version": "3.0.0"
},
"lodash._reevaluate": {
"version": "3.0.0"
},
"lodash._reinterpolate": {
"version": "3.0.0"
},
"lodash.template": {
"version": "3.6.1",
"dependencies": {
"lodash._basecopy": {
"version": "3.0.1"
},
"lodash._basetostring": {
"version": "3.0.0"
},
"lodash._basevalues": {
"version": "3.0.0"
},
"lodash._isiterateecall": {
"version": "3.0.9"
},
"lodash.escape": {
"version": "3.0.0"
},
"lodash.keys": {
"version": "3.1.1",
"dependencies": {
"lodash._getnative": {
"version": "3.9.0"
},
"lodash.isarguments": {
"version": "3.0.3"
},
"lodash.isarray": {
"version": "3.0.3"
}
}
},
"lodash.restparam": {
"version": "3.6.1"
},
"lodash.templatesettings": {
"version": "3.1.0"
}
}
},
"multipipe": {
"version": "0.1.2",
"dependencies": {
"duplexer2": {
"version": "0.0.2",
"dependencies": {
"readable-stream": {
"version": "1.1.13",
"dependencies": {
"core-util-is": {
"version": "1.0.1"
},
"isarray": {
"version": "0.0.1"
},
"string_decoder": {
"version": "0.10.31"
},
"inherits": {
"version": "2.0.1"
}
}
}
}
}
}
},
"object-assign": {
"version": "2.1.1"
},
"replace-ext": {
"version": "0.0.1"
}
}
},
"uglify-js": {
"version": "2.4.19",
"dependencies": {
"async": {
"version": "0.2.10"
},
"source-map": {
"version": "0.1.34",
"dependencies": {
"amdefine": {
"version": "0.1.1"
}
}
},
"yargs": {
"version": "3.5.4",
"dependencies": {
"camelcase": {
"version": "1.1.0"
},
"decamelize": {
"version": "1.0.0"
},
"window-size": {
"version": "0.1.0"
},
"wordwrap": {
"version": "0.0.2"
}
}
},
"uglify-to-browserify": {
"version": "1.0.2"
}
}
},
"vinyl-sourcemaps-apply": {
"version": "0.1.4",
"dependencies": {
"source-map": {
"version": "0.1.43",
"dependencies": {
"amdefine": {
"version": "0.1.1"
}
}
}
}
}
}
},
"gulp-webserver": {
"version": "0.8.8",
"dependencies": {

314
npm-shrinkwrap.json generated
View File

@ -9812,6 +9812,320 @@
}
}
},
"gulp-uglify": {
"version": "1.2.0",
"from": "gulp-uglify@*",
"resolved": "https://registry.npmjs.org/gulp-uglify/-/gulp-uglify-1.2.0.tgz",
"dependencies": {
"deap": {
"version": "1.0.0",
"from": "deap@>=1.0.0 <2.0.0-0",
"resolved": "https://registry.npmjs.org/deap/-/deap-1.0.0.tgz"
},
"gulp-util": {
"version": "3.0.5",
"from": "gulp-util@>=3.0.0 <4.0.0-0",
"resolved": "https://registry.npmjs.org/gulp-util/-/gulp-util-3.0.5.tgz",
"dependencies": {
"array-differ": {
"version": "1.0.0",
"from": "array-differ@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz"
},
"array-uniq": {
"version": "1.0.2",
"from": "array-uniq@>=1.0.2 <2.0.0",
"resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.2.tgz"
},
"beeper": {
"version": "1.1.0",
"from": "beeper@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/beeper/-/beeper-1.1.0.tgz"
},
"chalk": {
"version": "1.0.0",
"from": "chalk@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.0.0.tgz",
"dependencies": {
"ansi-styles": {
"version": "2.0.1",
"from": "ansi-styles@>=2.0.1 <3.0.0",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.0.1.tgz"
},
"escape-string-regexp": {
"version": "1.0.3",
"from": "escape-string-regexp@>=1.0.2 <2.0.0",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz"
},
"has-ansi": {
"version": "1.0.3",
"from": "has-ansi@>=1.0.3 <2.0.0",
"resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-1.0.3.tgz",
"dependencies": {
"ansi-regex": {
"version": "1.1.1",
"from": "ansi-regex@>=1.1.0 <2.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz"
},
"get-stdin": {
"version": "4.0.1",
"from": "get-stdin@>=4.0.1 <5.0.0",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz"
}
}
},
"supports-color": {
"version": "1.3.1",
"from": "supports-color@>=1.3.0 <2.0.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-1.3.1.tgz"
}
}
},
"dateformat": {
"version": "1.0.11",
"from": "dateformat@>=1.0.11 <2.0.0",
"resolved": "https://registry.npmjs.org/dateformat/-/dateformat-1.0.11.tgz",
"dependencies": {
"get-stdin": {
"version": "4.0.1",
"from": "get-stdin@*",
"resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz"
},
"meow": {
"version": "3.1.0",
"from": "meow@*",
"resolved": "https://registry.npmjs.org/meow/-/meow-3.1.0.tgz",
"dependencies": {
"camelcase-keys": {
"version": "1.0.0",
"from": "camelcase-keys@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-1.0.0.tgz",
"dependencies": {
"camelcase": {
"version": "1.1.0",
"from": "camelcase@>=1.0.1 <2.0.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.1.0.tgz"
},
"map-obj": {
"version": "1.0.1",
"from": "map-obj@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz"
}
}
}
}
}
}
},
"lodash._reescape": {
"version": "3.0.0",
"from": "lodash._reescape@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash._reescape/-/lodash._reescape-3.0.0.tgz"
},
"lodash._reevaluate": {
"version": "3.0.0",
"from": "lodash._reevaluate@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash._reevaluate/-/lodash._reevaluate-3.0.0.tgz"
},
"lodash._reinterpolate": {
"version": "3.0.0",
"from": "lodash._reinterpolate@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash._reinterpolate/-/lodash._reinterpolate-3.0.0.tgz"
},
"lodash.template": {
"version": "3.6.1",
"from": "lodash.template@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-3.6.1.tgz",
"dependencies": {
"lodash._basecopy": {
"version": "3.0.1",
"from": "lodash._basecopy@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz"
},
"lodash._basetostring": {
"version": "3.0.0",
"from": "lodash._basetostring@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.0.tgz"
},
"lodash._basevalues": {
"version": "3.0.0",
"from": "lodash._basevalues@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash._basevalues/-/lodash._basevalues-3.0.0.tgz"
},
"lodash._isiterateecall": {
"version": "3.0.9",
"from": "lodash._isiterateecall@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz"
},
"lodash.escape": {
"version": "3.0.0",
"from": "lodash.escape@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.0.0.tgz"
},
"lodash.keys": {
"version": "3.1.1",
"from": "lodash.keys@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.1.tgz",
"dependencies": {
"lodash._getnative": {
"version": "3.9.0",
"from": "lodash._getnative@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.0.tgz"
},
"lodash.isarguments": {
"version": "3.0.3",
"from": "lodash.isarguments@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.0.3.tgz"
},
"lodash.isarray": {
"version": "3.0.3",
"from": "lodash.isarray@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.3.tgz"
}
}
},
"lodash.restparam": {
"version": "3.6.1",
"from": "lodash.restparam@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz"
},
"lodash.templatesettings": {
"version": "3.1.0",
"from": "lodash.templatesettings@>=3.0.0 <4.0.0",
"resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-3.1.0.tgz"
}
}
},
"multipipe": {
"version": "0.1.2",
"from": "multipipe@>=0.1.2 <0.2.0",
"resolved": "https://registry.npmjs.org/multipipe/-/multipipe-0.1.2.tgz",
"dependencies": {
"duplexer2": {
"version": "0.0.2",
"from": "duplexer2@0.0.2",
"resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.0.2.tgz",
"dependencies": {
"readable-stream": {
"version": "1.1.13",
"from": "readable-stream@>=1.1.9 <1.2.0",
"resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.13.tgz",
"dependencies": {
"core-util-is": {
"version": "1.0.1",
"from": "core-util-is@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz"
},
"isarray": {
"version": "0.0.1",
"from": "isarray@0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz"
},
"string_decoder": {
"version": "0.10.31",
"from": "string_decoder@>=0.10.0 <0.11.0",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
},
"inherits": {
"version": "2.0.1",
"from": "inherits@>=2.0.1 <2.1.0",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
}
}
}
}
}
}
},
"object-assign": {
"version": "2.1.1",
"from": "object-assign@>=2.0.0 <3.0.0",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-2.1.1.tgz"
},
"replace-ext": {
"version": "0.0.1",
"from": "replace-ext@0.0.1",
"resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz"
}
}
},
"uglify-js": {
"version": "2.4.19",
"from": "uglify-js@2.4.19",
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.4.19.tgz",
"dependencies": {
"async": {
"version": "0.2.10",
"from": "async@>=0.2.6 <0.3.0",
"resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz"
},
"source-map": {
"version": "0.1.34",
"from": "source-map@0.1.34",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.34.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.1",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.1.tgz"
}
}
},
"yargs": {
"version": "3.5.4",
"from": "yargs@>=3.5.4 <3.6.0",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-3.5.4.tgz",
"dependencies": {
"camelcase": {
"version": "1.1.0",
"from": "camelcase@>=1.0.2 <2.0.0",
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.1.0.tgz"
},
"decamelize": {
"version": "1.0.0",
"from": "decamelize@>=1.0.0 <2.0.0",
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.0.0.tgz"
},
"window-size": {
"version": "0.1.0",
"from": "window-size@0.1.0",
"resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz"
},
"wordwrap": {
"version": "0.0.2",
"from": "wordwrap@0.0.2",
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz"
}
}
},
"uglify-to-browserify": {
"version": "1.0.2",
"from": "uglify-to-browserify@>=1.0.0 <1.1.0",
"resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz"
}
}
},
"vinyl-sourcemaps-apply": {
"version": "0.1.4",
"from": "vinyl-sourcemaps-apply@>=0.1.1 <0.2.0-0",
"resolved": "https://registry.npmjs.org/vinyl-sourcemaps-apply/-/vinyl-sourcemaps-apply-0.1.4.tgz",
"dependencies": {
"source-map": {
"version": "0.1.43",
"from": "source-map@>=0.1.39 <0.2.0",
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz",
"dependencies": {
"amdefine": {
"version": "0.1.1",
"from": "amdefine@>=0.0.4",
"resolved": "https://registry.npmjs.org/amdefine/-/amdefine-0.1.1.tgz"
}
}
}
}
}
}
},
"gulp-webserver": {
"version": "0.8.8",
"from": "https://registry.npmjs.org/gulp-webserver/-/gulp-webserver-0.8.8.tgz",

View File

@ -78,6 +78,7 @@
"gulp-template": "^3.0.0",
"gulp-traceur": "0.17.*",
"gulp-typescript": "^2.6.0",
"gulp-uglify": "^1.2.0",
"gulp-webserver": "^0.8.7",
"html2jade": "^0.8.3",
"indent-string": "^1.2.1",