Skip to content

Commit

Permalink
Merge pull request #1377 from dotansimha/feat/watch-string
Browse files Browse the repository at this point in the history
Allow to pass glob or list of files to watch
  • Loading branch information
dotansimha authored Mar 1, 2019
2 parents 0a2f500 + e560e7b commit a6c71b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/graphql-codegen-cli/src/utils/watcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ export const createWatcher = (config: Types.Config, onNext: (result: FileOutput[
}
});

if (typeof config.watch !== 'boolean') {
files.push(...normalizeInstanceOrArray<string>(config.watch));
}

let watcher: any;

const runWatcher = async () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-codegen-core/src/yml-config-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export namespace Types {
config?: { [key: string]: any };
generates: { [filename: string]: OutputConfig | ConfiguredOutput };
overwrite?: boolean;
watch?: boolean;
watch?: boolean | string | string[];
silent?: boolean;
pluginLoader?: PluginLoaderFn;
}
Expand Down

0 comments on commit a6c71b8

Please sign in to comment.