mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-14 23:18:36 +00:00
add
This commit is contained in:
12
build/buildConfig.ts
Normal file
12
build/buildConfig.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* When `true`, self-hosting uses esbuild for fast transpilation (build/next)
|
||||
* and gulp-tsb only for type-checking (`noEmit`).
|
||||
*
|
||||
* When `false`, gulp-tsb does both transpilation and type-checking (old behavior).
|
||||
*/
|
||||
export const useEsbuildTranspile = true;
|
||||
@@ -13,6 +13,7 @@ import { compileExtensionMediaTask, compileExtensionsTask, watchExtensionsTask }
|
||||
import * as compilation from './lib/compilation.ts';
|
||||
import * as task from './lib/task.ts';
|
||||
import * as util from './lib/util.ts';
|
||||
import { useEsbuildTranspile } from './buildConfig.ts';
|
||||
|
||||
const require = createRequire(import.meta.url);
|
||||
|
||||
@@ -32,7 +33,9 @@ gulp.task(transpileClientTask);
|
||||
const compileClientTask = task.define('compile-client', task.series(util.rimraf('out'), compilation.copyCodiconsTask, compilation.compileApiProposalNamesTask, compilation.compileTask('src', 'out', false)));
|
||||
gulp.task(compileClientTask);
|
||||
|
||||
const watchClientTask = task.define('watch-client', task.parallel(compilation.watchTask('out', false, 'src', { noEmit: true }), compilation.watchApiProposalNamesTask, compilation.watchCodiconsTask));
|
||||
const watchClientTask = useEsbuildTranspile
|
||||
? task.define('watch-client', task.parallel(compilation.watchTask('out', false, 'src', { noEmit: true }), compilation.watchApiProposalNamesTask, compilation.watchCodiconsTask))
|
||||
: task.define('watch-client', task.series(util.rimraf('out'), task.parallel(compilation.watchTask('out', false), compilation.watchApiProposalNamesTask, compilation.watchCodiconsTask)));
|
||||
gulp.task(watchClientTask);
|
||||
|
||||
// All
|
||||
|
||||
@@ -13,6 +13,7 @@ import { nlsPlugin, createNLSCollector, finalizeNLS, postProcessNLS } from './nl
|
||||
import { getVersion } from '../lib/getVersion.ts';
|
||||
import product from '../../product.json' with { type: 'json' };
|
||||
import packageJson from '../../package.json' with { type: 'json' };
|
||||
import { useEsbuildTranspile } from '../buildConfig.ts';
|
||||
|
||||
const globAsync = promisify(glob);
|
||||
|
||||
@@ -919,6 +920,14 @@ ${tslib}`,
|
||||
// ============================================================================
|
||||
|
||||
async function watch(): Promise<void> {
|
||||
if (!useEsbuildTranspile) {
|
||||
console.log('Starting transpilation...');
|
||||
console.log('Finished transpilation with 0 errors after 0 ms');
|
||||
console.log('[watch] esbuild transpile disabled (useEsbuildTranspile=false). Keeping process alive as no-op.');
|
||||
await new Promise(() => { }); // keep alive
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('Starting transpilation...');
|
||||
|
||||
const outDir = OUT_DIR;
|
||||
|
||||
Reference in New Issue
Block a user