File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -488,10 +488,15 @@ export function create (rawOptions: CreateOptions = {}): Register {
488488 let getTypeInfo : ( _code : string , _fileName : string , _position : number ) => TypeInfo
489489
490490 const getOutputTranspileOnly = ( code : string , fileName : string , overrideCompilerOptions ?: Partial < _ts . CompilerOptions > ) : SourceOutput => {
491+ if ( typeof transformers === 'function' ) {
492+ throw new TypeError ( 'Transformers function is unavailable in "--transpile-only"' )
493+ }
494+
491495 const result = ts . transpileModule ( code , {
492496 fileName,
493497 compilerOptions : overrideCompilerOptions ? { ...config . options , ...overrideCompilerOptions } : config . options ,
494- reportDiagnostics : true
498+ reportDiagnostics : true ,
499+ transformers : transformers
495500 } )
496501
497502 const diagnosticList = filterDiagnostics ( result . diagnostics || [ ] , ignoreDiagnostics )
@@ -785,10 +790,6 @@ export function create (rawOptions: CreateOptions = {}): Register {
785790 }
786791 }
787792 } else {
788- if ( typeof transformers === 'function' ) {
789- throw new TypeError ( 'Transformers function is unavailable in "--transpile-only"' )
790- }
791-
792793 getOutput = getOutputTranspileOnly
793794
794795 getTypeInfo = ( ) => {
You can’t perform that action at this time.
0 commit comments