support "@types" in treeshaker
This commit is contained in:
parent
0eb3a02ca2
commit
bb383f2875
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue