Skip to content

Commit a025702

Browse files
committed
Merge pull request Polymer#1793 from Polymer/faster-builds
Use gulp-vulcanize concurrently for faster builds
2 parents 3c70d64 + 43504e6 commit a025702

File tree

2 files changed

+12
-25
lines changed

2 files changed

+12
-25
lines changed

gulpfile.js

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ var lazypipe = require('lazypipe');
2121
var polyclean = require('polyclean');
2222
var del = require('del');
2323

24-
var fs = require('fs');
2524
var path = require('path');
2625

2726
var micro = "polymer-micro.html";
@@ -62,30 +61,22 @@ function vulcanizeWithExcludes(target, excludes) {
6261
};
6362
}
6463

65-
gulp.task('micro', ['mkdir'], vulcanizeWithExcludes(micro));
66-
gulp.task('mini', ['mkdir'], vulcanizeWithExcludes(mini, [micro]));
67-
gulp.task('max', ['mkdir'], vulcanizeWithExcludes(max, [mini, micro]));
64+
gulp.task('micro', vulcanizeWithExcludes(micro));
65+
gulp.task('mini', vulcanizeWithExcludes(mini, [micro]));
66+
gulp.task('max', vulcanizeWithExcludes(max, [mini, micro]));
6867

6968
gulp.task('clean', function(cb) {
7069
del(workdir, cb);
7170
});
7271

73-
gulp.task('mkdir', function(cb) {
74-
fs.exists(workdir, function(exists) {
75-
return exists ? cb() : fs.mkdir(workdir, null, cb);
76-
});
77-
});
78-
7972
// copy bower.json into dist folder
80-
gulp.task('copy-bower-json', ['mkdir'], function() {
73+
gulp.task('copy-bower-json', function() {
8174
return gulp.src('bower.json').pipe(gulp.dest(workdir));
8275
});
8376

8477
// Default Task
85-
gulp.task('default', ['clean'], function(cb) {
86-
// work around vulcanize not supporting concurrent builds
87-
// Vulcanize bug: https://github.com/Polymer/vulcanize/issues/190
88-
runseq('micro', 'mini', 'max', cb);
78+
gulp.task('default', function(cb) {
79+
runseq('clean', ['micro', 'mini', 'max'], cb);
8980
});
9081

9182
// switch src and build for testing
@@ -114,22 +105,18 @@ gulp.task('switch-build', function() {
114105
.pipe(gulp.dest('.'));
115106
});
116107

117-
gulp.task('switch', ['default'], function(cb) {
118-
runseq('save-src', 'switch-build', cb);
108+
gulp.task('switch', function(cb) {
109+
runseq('default', 'save-src', 'switch-build', cb);
119110
});
120111

121-
gulp.task('restore', ['clean'], function(cb) {
112+
gulp.task('restore', function(cb) {
122113
runseq('restore-src', 'cleanup-switch', cb);
123114
});
124115

125116
gulp.task('audit', function() {
126117
return gulp.src([distMini, distMicro, distMax])
127-
.pipe(audit('build.log', {
128-
repos: [
129-
'.'
130-
]
131-
}))
132-
.pipe(gulp.dest('dist'));
118+
.pipe(audit('build.log', { repos: ['.'] }))
119+
.pipe(gulp.dest(workdir));
133120
});
134121

135122
gulp.task('release', function(cb) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"gulp-audit": "^1.0.0",
1414
"gulp-rename": "^1.2.2",
1515
"gulp-replace": "^0.5.3",
16-
"gulp-vulcanize": "^6.0.0",
16+
"gulp-vulcanize": "^6.0.1",
1717
"lazypipe": "^0.2.3",
1818
"polyclean": "^1.2.0",
1919
"run-sequence": "^1.1.0"

0 commit comments

Comments
 (0)