Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf(transformer): remove createProgram from transpiler #1941

Merged
merged 1 commit into from Sep 11, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/compiler/transpiler.ts
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,
}
}