Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1095,25 +1095,17 @@ gulp.task('!bundle.js.prod', ['build.js.prod'], function() {

// minified production build
gulp.task('!bundle.js.min', ['build.js.prod'], function() {
return bundler.bundle(
bundleConfig,
'angular2/angular2',
'./dist/build/angular2.min.js',
{
sourceMaps: true,
minify: true
}).
then(function(){
return bundler.bundle(
bundleConfig,
'angular2/http',
'./dist/build/http.min.js',
{
sourceMaps: true,
minify: true
}
);
});
var q = require('q');
var minBundleConfig = {
sourceMaps: true,
minify: true
};

return q.all([
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this actually make a difference? unless the bundler runs in a different process (which I don't believe is the case) then the whole task is cpu/thread- bound and parallelizing doesn't make things any faster.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@IgorMinar oh, honestly for me eventual perf improvement was just a bonus as compared to the code improvement. I've decided to change this when adding config for a router and parallel version felt so much better / easier to write and read.

So for me it was just to shorten the code and explicitly express that we don't need to run those things in sequence as the previous code implied.

bundler.bundle(bundleConfig, 'angular2/angular2', './dist/build/angular2.min.js', minBundleConfig),
bundler.bundle(bundleConfig, 'angular2/http', './dist/build/http.min.js', minBundleConfig),
bundler.bundle(bundleConfig, 'angular2/router - angular2/angular2', './dist/js/bundle/router.dev.min.js', minBundleConfig)
]);
});

// development build
Expand Down