mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-27 13:40:25 +00:00
support "@types" in treeshaker
This commit is contained in:
@@ -55,6 +55,13 @@ export function extractEditor(options: tss.ITreeShakingOptions & { destRoot: str
|
||||
// Take the extra included .d.ts files from `tsconfig.monaco.json`
|
||||
options.typings = (<string[]>tsConfig.include).filter(includedFile => /\.d\.ts$/.test(includedFile));
|
||||
|
||||
// Add extra .d.ts files from `node_modules/@types/`
|
||||
if (Array.isArray(options.compilerOptions?.types)) {
|
||||
options.compilerOptions.types.forEach((type: string) => {
|
||||
options.typings.push(`../node_modules/@types/${type}/index.d.ts`);
|
||||
});
|
||||
}
|
||||
|
||||
let result = tss.shake(options);
|
||||
for (let fileName in result) {
|
||||
if (result.hasOwnProperty(fileName)) {
|
||||
|
||||
Reference in New Issue
Block a user