diff --git a/cli/asc.d.ts b/cli/asc.d.ts index bb60c5008c..0fcc0a7524 100644 --- a/cli/asc.d.ts +++ b/cli/asc.d.ts @@ -5,6 +5,7 @@ import { OptionDescription } from "./util/options"; export { OptionDescription }; +import { Transform } from "./transform"; /** Ready promise resolved once/if the compiler is ready. */ export const ready: Promise; @@ -192,6 +193,8 @@ export interface APIOptions { listFiles?: (dirname: string, baseDir: string) => string[] | null; /** Handler for diagnostic messages. */ reportDiagnostic?: DiagnosticReporter; + /** Additional transforms to apply. */ + transforms?: Transform[]; } /** Convenience function that parses and compiles source strings directly. */ diff --git a/cli/asc.js b/cli/asc.js index bbc9c1aca4..341aac5cd5 100644 --- a/cli/asc.js +++ b/cli/asc.js @@ -501,6 +501,9 @@ exports.main = function main(argv, options, callback) { // Set up transforms const transforms = []; + if (Array.isArray(options.transforms)) { + transforms.push(...options.transforms); + } if (opts.transform) { let tsNodeRegistered = false; let transformArgs = unique(opts.transform);