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

Commit

Permalink
custom transformers
Browse files Browse the repository at this point in the history
  • Loading branch information
goloveychuk committed May 13, 2017
1 parent b511d7e commit aaad15d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/checker/runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,9 @@ function createChecker(receive: (cb: (msg: Req) => void) => void, send: (msg: Re
});

const program = service.getProgram();

if (loaderConfig.customTranformersPath !== undefined) {
if (loaderConfig.getCustomTransformers !== undefined) {
host.getCustomTransformers = loaderConfig.getCustomTransformers(program);
} else if (loaderConfig.customTranformersPath !== undefined) {
host.getCustomTransformers = require(loaderConfig.customTranformersPath)(program);
}

Expand Down
1 change: 1 addition & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface LoaderConfig {
entryFileIsJs?: boolean;
debug?: boolean;
customTranformersPath?: string;
getCustomTransformers?: (program: ts.Program) => ts.CustomTransformers
}

export interface OutputFile {
Expand Down

0 comments on commit aaad15d

Please sign in to comment.