diff --git a/src/lib/application.ts b/src/lib/application.ts index 3d063b250..122c5367f 100644 --- a/src/lib/application.ts +++ b/src/lib/application.ts @@ -115,7 +115,7 @@ export class Application extends ChildableComponent 0) { event.inputFiles = files; } } diff --git a/src/lib/utils/options/readers/tsconfig.ts b/src/lib/utils/options/readers/tsconfig.ts index f1aef133b..d0430bb9e 100644 --- a/src/lib/utils/options/readers/tsconfig.ts +++ b/src/lib/utils/options/readers/tsconfig.ts @@ -4,7 +4,7 @@ import * as _ from 'lodash'; import * as ts from 'typescript'; import { Component, Option } from '../../component'; -import { OptionsComponent, DiscoverEvent } from '../options'; +import { OptionsComponent, OptionsReadMode, DiscoverEvent } from '../options'; import { ParameterType, ParameterHint } from '../declaration'; import { TypeScriptSource } from '../sources/typescript'; @@ -35,6 +35,11 @@ export class TSConfigReader extends OptionsComponent { } onDiscover(event: DiscoverEvent) { + // Do nothing until were fetching options + if (event.mode !== OptionsReadMode.Fetch) { + return; + } + if (TSConfigReader.OPTIONS_KEY in event.data) { this.load(event, Path.resolve(event.data[TSConfigReader.OPTIONS_KEY])); } else if (TSConfigReader.PROJECT_KEY in event.data) { diff --git a/src/lib/utils/options/readers/typedoc.ts b/src/lib/utils/options/readers/typedoc.ts index ad5a44f04..a03e8df11 100644 --- a/src/lib/utils/options/readers/typedoc.ts +++ b/src/lib/utils/options/readers/typedoc.ts @@ -3,7 +3,7 @@ import * as FS from 'fs'; import * as _ from 'lodash'; import { Component, Option } from '../../component'; -import { OptionsComponent, DiscoverEvent } from '../options'; +import { OptionsComponent, OptionsReadMode, DiscoverEvent } from '../options'; import { ParameterType, ParameterHint } from '../declaration'; @Component({name: 'options:typedoc'}) @@ -26,6 +26,11 @@ export class TypedocReader extends OptionsComponent { } onDiscover(event: DiscoverEvent) { + // Do nothing until were fetching options + if (event.mode !== OptionsReadMode.Fetch) { + return; + } + if (TypedocReader.OPTIONS_KEY in event.data) { this.load(event, Path.resolve(event.data[TypedocReader.OPTIONS_KEY])); } else if (this.application.isCLI) {