File tree 2 files changed +6
-9
lines changed
2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 7
7
"typescript" : " 4.6.2"
8
8
},
9
9
"scripts" : {
10
- "postinstall" : " node ./postinstall"
10
+ "postinstall" : " node ./postinstall.mjs "
11
11
},
12
12
"devDependencies" : {
13
13
"esbuild" : " ^0.11.12" ,
Original file line number Diff line number Diff line change 2
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
- // @ts -check
6
5
7
- 'use strict' ;
6
+ import * as fs from 'fs' ;
7
+ import path from 'path' ;
8
+ import { fileURLToPath } from 'url' ;
8
9
9
- const fs = require ( 'fs' ) ;
10
- const path = require ( 'path' ) ;
11
- const rimraf = require ( 'rimraf' ) ;
12
-
13
- const root = path . join ( __dirname , 'node_modules' , 'typescript' ) ;
10
+ const root = path . join ( path . dirname ( fileURLToPath ( import . meta. url ) ) , 'node_modules' , 'typescript' ) ;
14
11
15
12
function processRoot ( ) {
16
13
const toKeep = new Set ( [
@@ -21,7 +18,7 @@ function processRoot() {
21
18
if ( ! toKeep . has ( name ) ) {
22
19
const filePath = path . join ( root , name ) ;
23
20
console . log ( `Removed ${ filePath } ` ) ;
24
- rimraf . sync ( filePath ) ;
21
+ fs . rmSync ( filePath , { recursive : true } ) ;
25
22
}
26
23
}
27
24
}
You can’t perform that action at this time.
0 commit comments