@@ -27,6 +27,13 @@ function writeFile(filePath, contents) {
2727 fs . writeFileSync ( filePath , contents ) ;
2828}
2929function extractEditor ( options ) {
30+ var tsConfig = JSON . parse ( fs . readFileSync ( path . join ( options . sourcesRoot , 'tsconfig.json' ) ) . toString ( ) ) ;
31+ tsConfig . compilerOptions . noUnusedLocals = false ;
32+ tsConfig . compilerOptions . preserveConstEnums = false ;
33+ tsConfig . compilerOptions . declaration = false ;
34+ delete tsConfig . compilerOptions . types ;
35+ tsConfig . exclude = [ ] ;
36+ options . compilerOptions = tsConfig . compilerOptions ;
3037 var result = tss . shake ( options ) ;
3138 for ( var fileName in result ) {
3239 if ( result . hasOwnProperty ( fileName ) ) {
@@ -73,25 +80,16 @@ function extractEditor(options) {
7380 }
7481 }
7582 }
76- var tsConfig = JSON . parse ( fs . readFileSync ( path . join ( options . sourcesRoot , 'tsconfig.json' ) ) . toString ( ) ) ;
77- tsConfig . compilerOptions . noUnusedLocals = false ;
78- tsConfig . compilerOptions . preserveConstEnums = false ;
79- tsConfig . compilerOptions . declaration = false ;
8083 writeOutputFile ( 'tsconfig.json' , JSON . stringify ( tsConfig , null , '\t' ) ) ;
8184 [
8285 'vs/css.build.js' ,
8386 'vs/css.d.ts' ,
8487 'vs/css.js' ,
8588 'vs/loader.js' ,
86- 'vs/monaco.d.ts' ,
8789 'vs/nls.build.js' ,
8890 'vs/nls.d.ts' ,
8991 'vs/nls.js' ,
9092 'vs/nls.mock.ts' ,
91- 'typings/lib.ie11_safe_es6.d.ts' ,
92- 'typings/thenable.d.ts' ,
93- 'typings/es6-promise.d.ts' ,
94- 'typings/require.d.ts' ,
9593 ] . forEach ( copyFile ) ;
9694}
9795exports . extractEditor = extractEditor ;
@@ -102,7 +100,7 @@ function createESMSourcesAndResources2(options) {
102100 var getDestAbsoluteFilePath = function ( file ) {
103101 var dest = options . renames [ file . replace ( / \\ / g, '/' ) ] || file ;
104102 if ( dest === 'tsconfig.json' ) {
105- return path . join ( OUT_FOLDER , "../ tsconfig.json" ) ;
103+ return path . join ( OUT_FOLDER , "tsconfig.json" ) ;
106104 }
107105 if ( / \. t s $ / . test ( dest ) ) {
108106 return path . join ( OUT_FOLDER , dest ) ;
@@ -117,11 +115,8 @@ function createESMSourcesAndResources2(options) {
117115 }
118116 if ( file === 'tsconfig.json' ) {
119117 var tsConfig = JSON . parse ( fs . readFileSync ( path . join ( SRC_FOLDER , file ) ) . toString ( ) ) ;
120- tsConfig . compilerOptions . moduleResolution = undefined ;
121- tsConfig . compilerOptions . baseUrl = undefined ;
122118 tsConfig . compilerOptions . module = 'es6' ;
123- tsConfig . compilerOptions . rootDir = 'src' ;
124- tsConfig . compilerOptions . outDir = path . relative ( path . dirname ( OUT_FOLDER ) , OUT_RESOURCES_FOLDER ) ;
119+ tsConfig . compilerOptions . outDir = path . join ( path . relative ( OUT_FOLDER , OUT_RESOURCES_FOLDER ) , 'vs' ) ;
125120 write ( getDestAbsoluteFilePath ( file ) , JSON . stringify ( tsConfig , null , '\t' ) ) ;
126121 continue ;
127122 }
0 commit comments