Skip to content

Commit

Permalink
perf(transformer): remove CreateProgram from transpiler to boost star…
Browse files Browse the repository at this point in the history
…tup speed
  • Loading branch information
zhming0 committed Sep 11, 2020
1 parent 949ffb2 commit c8f32bc
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/compiler/transpiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ import type { CompilerInstance, SourceOutput } from '../types'
export const initializeTranspilerInstance = (configs: ConfigSet, logger: Logger): CompilerInstance => {
logger.debug('initializeTranspilerInstance(): create typescript compiler')

const { options, fileNames } = configs.parsedTsConfig
const { options } = configs.parsedTsConfig
const ts = configs.compilerModule
const program = ts.createProgram(fileNames, options)

return {
compileFn: (code: string, fileName: string): SourceOutput => {
Expand All @@ -31,6 +30,6 @@ export const initializeTranspilerInstance = (configs: ConfigSet, logger: Logger)
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
return [result.outputText, result.sourceMapText!]
},
program,
program: undefined,
}
}

0 comments on commit c8f32bc

Please sign in to comment.