diff --git a/README.md b/README.md index 2b15b70b..930c2c7e 100644 --- a/README.md +++ b/README.md @@ -99,9 +99,9 @@ All imported files are watched except from the following directories: #### Ignore files from being watched -If you wish to exclude files from being watched, you can pass `--ignored` multiple times: +If you wish to exclude files from being watched, you can pass `--ignore` multiple times: ```sh -tsx watch --ignored ./ignore-me.js --ignored ./ignore-me-too.js ./file.ts +tsx watch --ignore ./ignore-me.js --ignore ./ignore-me-too.js ./file.ts ``` This flag is passed to [chokidar](https://github.com/paulmillr/chokidar) thus glob patterns also work here. diff --git a/src/watch/index.ts b/src/watch/index.ts index 33e101d1..7246838d 100644 --- a/src/watch/index.ts +++ b/src/watch/index.ts @@ -27,7 +27,7 @@ const flags = { description: 'Clearing the screen on rerun', default: true, }, - ignored: { + ignore: { type: [String], description: 'Paths & globs to exclude from being watched', default: [], @@ -52,7 +52,7 @@ export const watchCommand = command({ noCache: argv.flags.noCache, tsconfigPath: argv.flags.tsconfig, clearScreen: argv.flags.clearScreen, - ignored: argv.flags.ignored, + ignore: argv.flags.ignore, ipc: true, }; @@ -130,7 +130,7 @@ export const watchCommand = command({ // Distribution files '**/dist/**', - ...options.ignored, + ...options.ignore, ], ignorePermissionErrors: true, }, diff --git a/tests/specs/watch.ts b/tests/specs/watch.ts index 353832dc..9a56d872 100644 --- a/tests/specs/watch.ts +++ b/tests/specs/watch.ts @@ -164,8 +164,8 @@ export default testSuite(async ({ describe }, fixturePath: string) => { args: [ 'watch', '--clear-screen=false', - `--ignored=${path.join(fixtures.path, ignoredFilenames[0])}`, - `--ignored=${path.join(fixtures.path, ignoredFilenames[1])}`, + `--ignore=${path.join(fixtures.path, ignoredFilenames[0])}`, + `--ignore=${path.join(fixtures.path, ignoredFilenames[1])}`, path.join(fixtures.path, includedFilename), ], });