2019-02-05 09:03:46 +00:00
|
|
|
/*---------------------------------------------------------------------------------------------
|
|
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
2019-07-05 15:01:55 +00:00
|
|
|
const gulp = require('gulp');
|
2019-02-05 09:03:46 +00:00
|
|
|
const util = require('./lib/util');
|
2019-02-12 14:13:43 +00:00
|
|
|
const task = require('./lib/task');
|
2019-02-05 09:03:46 +00:00
|
|
|
const compilation = require('./lib/compilation');
|
2022-09-21 07:38:44 +00:00
|
|
|
const optimize = require('./lib/optimize');
|
2019-02-05 09:03:46 +00:00
|
|
|
|
2023-06-07 13:51:48 +00:00
|
|
|
function makeCompileBuildTask(disableMangle) {
|
|
|
|
return task.series(
|
2021-01-06 19:36:22 +00:00
|
|
|
util.rimraf('out-build'),
|
2021-08-11 15:59:14 +00:00
|
|
|
util.buildWebNodePaths('out-build'),
|
2022-10-26 08:59:54 +00:00
|
|
|
compilation.compileApiProposalNamesTask,
|
2023-06-07 13:51:48 +00:00
|
|
|
compilation.compileTask('src', 'out-build', true, { disableMangle }),
|
2022-09-21 07:38:44 +00:00
|
|
|
optimize.optimizeLoaderTask('out-build', 'out-build', true)
|
2023-06-07 13:51:48 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// Full compile, including nls and inline sources in sourcemaps, mangling, minification, for build
|
|
|
|
const compileBuildTask = task.define('compile-build', makeCompileBuildTask(false));
|
2019-07-05 15:01:55 +00:00
|
|
|
gulp.task(compileBuildTask);
|
2021-01-06 19:36:22 +00:00
|
|
|
exports.compileBuildTask = compileBuildTask;
|
2023-06-07 13:51:48 +00:00
|
|
|
|
|
|
|
// Full compile for PR ci, e.g no mangling
|
|
|
|
const compileBuildTaskPullRequest = task.define('compile-build-pr', makeCompileBuildTask(true));
|
|
|
|
gulp.task(compileBuildTaskPullRequest);
|
|
|
|
exports.compileBuildTaskPullRequest = compileBuildTaskPullRequest;
|