@@ -12,12 +12,28 @@ import { RushStackCompilerBase } from './RushStackCompilerBase';
1212/**
1313 * @beta
1414 */
15- export class TypescriptCompiler extends RushStackCompilerBase {
15+ export interface ITypescriptCompilerOptions {
16+ /**
17+ * Option to pass custom arguments to the tsc command.
18+ */
19+ customArgs ?: string [ ] ;
20+ }
21+
22+ /**
23+ * @beta
24+ */
25+ export class TypescriptCompiler extends RushStackCompilerBase < ITypescriptCompilerOptions > {
1626 public typescript : typeof typescript = typescript ;
1727 private _cmdRunner : CmdRunner ;
1828
19- constructor ( rootPath : string , terminalProvider : ITerminalProvider ) {
20- super ( { } , rootPath , terminalProvider ) ;
29+ constructor ( rootPath : string , terminalProvider : ITerminalProvider ) ;
30+ constructor ( taskOptions : ITypescriptCompilerOptions , rootPath : string , terminalProvider : ITerminalProvider ) ;
31+ constructor ( arg1 : ITypescriptCompilerOptions | string , arg2 : string | ITerminalProvider , arg3 ?: ITerminalProvider ) {
32+ super (
33+ typeof arg1 === 'string' ? { } : arg1 ,
34+ typeof arg2 === 'string' ? arg2 : arg1 as string ,
35+ arg3 ? arg3 : arg2 as ITerminalProvider
36+ ) ;
2137 this . _cmdRunner = new CmdRunner (
2238 this . _standardBuildFolders ,
2339 this . _terminal ,
@@ -31,7 +47,7 @@ export class TypescriptCompiler extends RushStackCompilerBase {
3147
3248 public invoke ( ) : Promise < void > {
3349 return this . _cmdRunner . runCmd ( {
34- args : [ ] ,
50+ args : this . _taskOptions . customArgs || [ ] ,
3551 onData : ( data : Buffer ) => {
3652 // Log lines separately
3753 const dataLines : ( string | undefined ) [ ] = data . toString ( ) . split ( '\n' ) ;
0 commit comments