mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
* Use common TS install for both the TS Extension and Html Extension **Bug** At least two version of Typescript are shipped in our extensions: one in the typescript extension and one for the html extension. This adds about 5MB to package install size and also results in inconsistent behavior **Fix** Change the TypeScript extension to also use the common version of TypeScript. Bump this version up to 2.2.1 * Don't hardcode paths for typescript
26 lines
946 B
JavaScript
26 lines
946 B
JavaScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
'use strict';
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const toDelete = new Set(['tsc.js', 'tsserverlibrary.js', 'typescript.js', 'typescriptServices.js']);
|
|
|
|
const root = path.join(__dirname, 'node_modules', 'typescript', 'lib');
|
|
for (let name of fs.readdirSync(root)) {
|
|
if (name === 'lib.d.ts' || name.match(/^lib\..*\.d\.ts$/) || name === 'protocol.d.ts') {
|
|
continue;
|
|
}
|
|
|
|
if (toDelete.has(name) || name.match(/\.d\.ts$/)) {
|
|
try {
|
|
fs.unlinkSync(path.join(root, name));
|
|
console.log(`removed '${path.join(root, name)}'`);
|
|
} catch (e) {
|
|
console.warn(e);
|
|
}
|
|
}
|
|
} |