@@ -164,14 +164,12 @@ function getCopyrightHeader() {
164
164
* @param {boolean } exportIsTsObject True if this file exports the TS object and should have relevant code injected.
165
165
*/
166
166
function esbuildTask ( entrypoint , outfile , exportIsTsObject = false ) {
167
- const preBabel = `${ outfile } .tmp.js` ;
168
-
169
167
/** @type {esbuild.BuildOptions } */
170
168
const options = {
171
169
entryPoints : [ entrypoint ] ,
172
170
banner : { js : getCopyrightHeader ( ) } ,
173
171
bundle : true ,
174
- outfile : preBabel ,
172
+ outfile,
175
173
platform : "node" ,
176
174
// TODO: also specify minimal browser targets
177
175
target : "node10" , // Node 10 is the oldest benchmarker.
@@ -208,19 +206,12 @@ function esbuildTask(entrypoint, outfile, exportIsTsObject = false) {
208
206
209
207
// TODO: these need to have better function names, for gulp.
210
208
return {
211
- build : async ( ) => {
212
- await esbuild . build ( options ) ;
213
- await exec ( process . execPath , [ "./node_modules/@babel/cli/bin/babel.js" , preBabel , "--out-file" , outfile , "--plugins" , "@babel/plugin-transform-block-scoping" , "--compact" , "false" , "--source-maps" ] ) ;
214
- await del ( [ preBabel , `${ preBabel } .map` ] ) ;
215
- } ,
209
+ build : ( ) => esbuild . build ( options ) ,
216
210
clean : ( ) => del ( [ outfile , `${ outfile } .map` ] ) ,
217
211
watch : ( ) => esbuild . build ( { ...options , watch : true } ) ,
218
212
} ;
219
213
}
220
214
221
- // TODO(jakebailey): Add this function to the non-bundle paths which
222
- // don't output to the correct location. (e.g., not dynamicImportCompat).
223
-
224
215
/**
225
216
* Creates a function that writes a CJS module that reexports another CJS file via
226
217
* `module.exports = require("...")`.
@@ -293,33 +284,25 @@ task("watch-services").flags = {
293
284
" --built" : "Compile using the built version of the compiler."
294
285
} ;
295
286
296
- const buildDynamicImportCompat = ( ) => buildProject ( "src/dynamicImportCompat" ) ;
297
- task ( "dynamicImportCompat" , buildDynamicImportCompat ) ;
298
-
299
- const cleanDynamicImportCompat = ( ) => cleanProject ( "src/dynamicImportCompat" ) ;
300
- const watchDynamicImportCompat = ( ) => watchProject ( "src/dynamicImportCompat" ) ;
301
-
302
287
303
288
const esbuildServer = esbuildTask ( "./src/tsserver/server.ts" , "./built/local/tsserver.js" , /* exportIsTsObject */ true ) ;
304
289
305
- const buildServerMain = ( ) => cmdLineOptions . bundle ? esbuildServer . build ( ) : buildProject ( "src/tsserver" ) ;
306
- const buildServer = series ( buildDynamicImportCompat , buildServerMain ) ;
290
+ const buildServer = ( ) => cmdLineOptions . bundle ? esbuildServer . build ( ) : buildProject ( "src/tsserver" ) ;
307
291
buildServer . displayName = "buildServer" ;
308
292
task ( "tsserver" , series ( preBuild , buildServer ) ) ;
309
293
task ( "tsserver" ) . description = "Builds the language server" ;
310
294
task ( "tsserver" ) . flags = {
311
295
" --built" : "Compile using the built version of the compiler."
312
296
} ;
313
297
314
- const cleanServerMain = ( ) => cmdLineOptions . bundle ? esbuildServer . clean ( ) : cleanProject ( "src/tsserver" ) ;
315
- const cleanServer = series ( cleanDynamicImportCompat , cleanServerMain ) ;
298
+ const cleanServer = ( ) => cmdLineOptions . bundle ? esbuildServer . clean ( ) : cleanProject ( "src/tsserver" ) ;
316
299
cleanServer . displayName = "cleanServer" ;
317
300
cleanTasks . push ( cleanServer ) ;
318
301
task ( "clean-tsserver" , cleanServer ) ;
319
302
task ( "clean-tsserver" ) . description = "Cleans outputs for the language server" ;
320
303
321
304
const watchServer = ( ) => cmdLineOptions . bundle ? esbuildServer . watch ( ) : watchProject ( "src/tsserver" ) ;
322
- task ( "watch-tsserver" , series ( preBuild , parallel ( watchLib , watchDiagnostics , watchDynamicImportCompat , watchServer ) ) ) ;
305
+ task ( "watch-tsserver" , series ( preBuild , parallel ( watchLib , watchDiagnostics , watchServer ) ) ) ;
323
306
task ( "watch-tsserver" ) . description = "Watch for changes and rebuild the language server only" ;
324
307
task ( "watch-tsserver" ) . flags = {
325
308
" --built" : "Compile using the built version of the compiler."
@@ -591,7 +574,6 @@ const produceLKG = async () => {
591
574
"built/local/typescriptServices.js" ,
592
575
"built/local/typescriptServices.d.ts" ,
593
576
"built/local/tsserver.js" ,
594
- "built/local/dynamicImportCompat.js" ,
595
577
"built/local/typescript.js" ,
596
578
"built/local/typescript.d.ts" ,
597
579
"built/local/tsserverlibrary.js" ,
0 commit comments