Skip to content

Commit 3974c1e

Browse files
committed
Load all gulpfiles only if necessary
1 parent 9c70ea1 commit 3974c1e

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

gulpfile.js

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,24 @@ gulp.task('mixin', function () {
258258
.pipe(gulp.dest('.'));
259259
});
260260

261-
const build = path.join(__dirname, 'build');
262-
glob.sync('gulpfile.*.js', { cwd: build })
263-
.forEach(f => require(`./build/${ f }`));
261+
var ALL_EDITOR_TASKS = [
262+
'clean-optimized-editor',
263+
'optimize-editor',
264+
'clean-minified-editor',
265+
'minify-editor',
266+
'clean-editor-distro',
267+
'editor-distro',
268+
'analyze-editor-distro'
269+
];
270+
var runningEditorTasks = process.argv.slice(2).every(function(arg) {
271+
return (ALL_EDITOR_TASKS.indexOf(arg) !== -1);
272+
});
273+
274+
if (runningEditorTasks) {
275+
require(`./build/gulpfile.editor`);
276+
} else {
277+
// Load all the gulpfiles only if running tasks other than the editor tasks
278+
const build = path.join(__dirname, 'build');
279+
glob.sync('gulpfile.*.js', { cwd: build })
280+
.forEach(f => require(`./build/${ f }`));
281+
}

0 commit comments

Comments
 (0)