Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

feat: pass ts.Program as an argument for getCustomTransformers #594

Merged
merged 2 commits into from Jun 21, 2018
Merged

feat: pass ts.Program as an argument for getCustomTransformers #594

merged 2 commits into from Jun 21, 2018

Conversation

kimamula
Copy link
Contributor

This enables using custom transformers which require ts.Program.
The feature has been already supported by rollup-plugin-typescript2.

@@ -433,7 +433,8 @@ function createChecker(receive: (cb: (msg: Req) => void) => void, send: (msg: Re
const trans = compiler.transpileModule(files.get(fileName).text, {
compilerOptions: compilerOptions,
fileName,
reportDiagnostics: false
reportDiagnostics: false,
transformers: finalTransformers ? finalTransformers(getProgram().getProgram()) : undefined
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is likely this line was accidentally removed in 38a772f.

See #531 (comment).

@s-panferov s-panferov merged commit c0d10bf into s-panferov:master Jun 21, 2018
@s-panferov
Copy link
Owner

@kimamula thanks!

@xiaoxiangmoe
Copy link

xiaoxiangmoe commented Nov 24, 2018

@kimamula Why pass ts.Program? rollup-plugin-typescript2 pass ts.LanguageService.

@kimamula
Copy link
Contributor Author

Because it was easier to implement.
I don't know whether ts.LanguageService is available in awesome-typescript-loader.
And I don't come up with a case in which ts.Program is not enough to implement custom transformers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants