@@ -141,6 +141,21 @@ var CONFIG = {
141141 }
142142} ;
143143
144+ var ANGULAR2_BUNDLE_CONFIG = [
145+ 'angular2/common' ,
146+ 'angular2/core' ,
147+ 'angular2/compiler' ,
148+ 'angular2/instrumentation' ,
149+ 'angular2/platform/browser' ,
150+ 'angular2/platform/common_dom' ,
151+ 'angular2/upgrade'
152+ ] ;
153+
154+ var NG2_BUNDLE_CONTENT = ANGULAR2_BUNDLE_CONFIG . join ( ' + ' ) ;
155+ var HTTP_BUNDLE_CONTENT = 'angular2/http - ' + ANGULAR2_BUNDLE_CONFIG . join ( ' - ' ) ;
156+ var ROUTER_BUNDLE_CONTENT = 'angular2/router - ' + ANGULAR2_BUNDLE_CONFIG . join ( ' - ' ) ;
157+ var TESTING_BUNDLE_CONTENT = 'angular2/testing - ' + ANGULAR2_BUNDLE_CONFIG . join ( ' - ' ) ;
158+
144159var BENCHPRESS_BUNDLE_CONFIG = {
145160 entries : [ './dist/js/cjs/benchpress/index.js' ] ,
146161 packageJson : './dist/js/cjs/benchpress/package.json' ,
@@ -1015,13 +1030,11 @@ gulp.task('!bundle.js.prod', ['build.js.prod'], function() {
10151030 var bundler = require ( './tools/build/bundle' ) ;
10161031 var bundlerConfig = { sourceMaps : true } ;
10171032
1018- return bundler . bundle ( bundleConfig , 'angular2/angular2' , './dist/build/angular2.js' ,
1019- bundlerConfig )
1033+ return bundler . bundle ( bundleConfig , NG2_BUNDLE_CONTENT , './dist/build/angular2.js' , bundlerConfig )
10201034 . then ( function ( ) {
10211035 return Promise . all ( [
1022- bundler . bundle ( bundleConfig , 'angular2/http - angular2/core' , './dist/build/http.js' ,
1023- bundlerConfig ) ,
1024- bundler . bundle ( bundleConfig , 'angular2/router - angular2/core' , './dist/build/router.js' ,
1036+ bundler . bundle ( bundleConfig , HTTP_BUNDLE_CONTENT , './dist/build/http.js' , bundlerConfig ) ,
1037+ bundler . bundle ( bundleConfig , ROUTER_BUNDLE_CONTENT , './dist/build/router.js' ,
10251038 bundlerConfig )
10261039 ] ) ;
10271040 } ) ;
@@ -1032,14 +1045,14 @@ gulp.task('!bundle.js.min', ['build.js.prod'], function() {
10321045 var bundler = require ( './tools/build/bundle' ) ;
10331046 var bundlerConfig = { sourceMaps : true , minify : true } ;
10341047
1035- return bundler . bundle ( bundleConfig , 'angular2/angular2' , './dist/build/angular2.min.js' ,
1048+ return bundler . bundle ( bundleConfig , NG2_BUNDLE_CONTENT , './dist/build/angular2.min.js' ,
10361049 bundlerConfig )
10371050 . then ( function ( ) {
10381051 return Promise . all ( [
1039- bundler . bundle ( bundleConfig , 'angular2/http - angular2/core' , './dist/build/http.min.js' ,
1052+ bundler . bundle ( bundleConfig , HTTP_BUNDLE_CONTENT , './dist/build/http.min.js' ,
10401053 bundlerConfig ) ,
1041- bundler . bundle ( bundleConfig , 'angular2/router - angular2/core ',
1042- './dist/build/router.min.js' , bundlerConfig )
1054+ bundler . bundle ( bundleConfig , ROUTER_BUNDLE_CONTENT , './dist/build/router.min.js ',
1055+ bundlerConfig )
10431056 ] ) ;
10441057 } ) ;
10451058} ) ;
@@ -1052,14 +1065,14 @@ gulp.task('!bundle.js.dev', ['build.js.dev'], function() {
10521065 var devBundleConfig = merge ( true , bundleConfig ) ;
10531066 devBundleConfig . paths = merge ( true , devBundleConfig . paths , { "*" : "dist/js/dev/es5/*.js" } ) ;
10541067
1055- return bundler . bundle ( devBundleConfig , 'angular2/angular2' , './dist/build/angular2.dev.js' ,
1068+ return bundler . bundle ( devBundleConfig , NG2_BUNDLE_CONTENT , './dist/build/angular2.dev.js' ,
10561069 bundlerConfig )
10571070 . then ( function ( ) {
10581071 return Promise . all ( [
1059- bundler . bundle ( devBundleConfig , 'angular2/http - angular2/core ',
1060- './dist/build/http.dev.js' , bundlerConfig ) ,
1061- bundler . bundle ( bundleConfig , 'angular2/router - angular2/core ',
1062- './dist/build/router.dev.js' , bundlerConfig )
1072+ bundler . bundle ( devBundleConfig , HTTP_BUNDLE_CONTENT , './dist/build/http.dev.js ',
1073+ bundlerConfig ) ,
1074+ bundler . bundle ( devBundleConfig , ROUTER_BUNDLE_CONTENT , './dist/build/router.dev.js ',
1075+ bundlerConfig )
10631076 ] ) ;
10641077 } ) ;
10651078} ) ;
@@ -1085,8 +1098,8 @@ gulp.task('!bundle.testing', ['build.js.dev'], function() {
10851098 var devBundleConfig = merge ( true , bundleConfig ) ;
10861099 devBundleConfig . paths = merge ( true , devBundleConfig . paths , { "*" : "dist/js/dev/es5/*.js" } ) ;
10871100
1088- return bundler . bundle ( devBundleConfig , 'angular2/testing - angular2/angular2 ',
1089- './dist/js/bundle/testing.js' , { sourceMaps : true } ) ;
1101+ return bundler . bundle ( devBundleConfig , TESTING_BUNDLE_CONTENT , './dist/js/bundle/testing.js ',
1102+ { sourceMaps : true } ) ;
10901103} ) ;
10911104
10921105gulp . task ( '!bundles.js.umd' , [ 'build.js.dev' ] , function ( ) {
0 commit comments