vscode/gulpfile.js

43 lines
1.9 KiB
JavaScript
Raw Normal View History

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
// Increase max listeners for event emitters
require('events').EventEmitter.defaultMaxListeners = 100;
const gulp = require('gulp');
const util = require('./build/lib/util');
2019-02-12 14:13:43 +00:00
const task = require('./build/lib/task');
const path = require('path');
const compilation = require('./build/lib/compilation');
2019-02-05 20:23:25 +00:00
const { monacoTypecheckTask/* , monacoTypecheckWatchTask */ } = require('./build/gulpfile.editor');
const { compileExtensionsTask, watchExtensionsTask } = require('./build/gulpfile.extensions');
// Fast compile for development time
2019-02-12 19:43:28 +00:00
const compileClientTask = task.define('compile-client', task.series(util.rimraf('out'), compilation.compileTask('src', 'out', false)));
gulp.task(compileClientTask);
2019-02-12 19:43:28 +00:00
const watchClientTask = task.define('watch-client', task.series(util.rimraf('out'), compilation.watchTask('out', false)));
gulp.task(watchClientTask);
// All
2019-02-12 19:43:28 +00:00
const compileTask = task.define('compile', task.parallel(monacoTypecheckTask, compileClientTask, compileExtensionsTask));
gulp.task(compileTask);
2019-02-05 20:23:25 +00:00
2019-02-12 19:43:28 +00:00
gulp.task(task.define('watch', task.parallel(/* monacoTypecheckWatchTask, */ watchClientTask, watchExtensionsTask)));
2019-02-05 20:23:25 +00:00
// Default
gulp.task('default', compileTask);
process.on('unhandledRejection', (reason, p) => {
console.log('Unhandled Rejection at: Promise', p, 'reason:', reason);
process.exit(1);
});
2018-08-17 15:03:08 +00:00
// Load all the gulpfiles only if running tasks other than the editor tasks
const build = path.join(__dirname, 'build');
require('glob').sync('gulpfile.*.js', { cwd: build })
2019-07-02 13:38:23 +00:00
.forEach(f => require(`./build/${f}`));