Skip to content

Commit

Permalink
docs(config): add watchIgnoredRegex (#1467)
Browse files Browse the repository at this point in the history
* docs(config): add watchIgnoredRegex

* Update docs/config/01-overview.md

Co-authored-by: Christian Bromann <[email protected]>

---------

Co-authored-by: Christian Bromann <[email protected]>
  • Loading branch information
tanner-reits and christian-bromann authored Aug 1, 2024
1 parent 1950c34 commit 97b5c45
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion docs/config/01-overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,4 +519,29 @@ Passes custom configuration down to rollup itself. The following options can be
- `inputOptions`: [`context`](https://rollupjs.org/configuration-options/#context), [`external`](https://rollupjs.org/configuration-options/#external), [`moduleContext`](https://rollupjs.org/configuration-options/#modulecontext) [`treeshake`](https://rollupjs.org/configuration-options/#treeshake)
- `outputOptions`: [`globals`](https://rollupjs.org/configuration-options/#output-globals)

*default: `{}`*
*default: `{}`*

## watchIgnoredRegex

*default: `[]`*

*type: `RegExp | RegExp[]`*

A regular expression (or array of regular expressions) that can be used to omit files from triggering a rebuild in watch mode. During compile-time, each file in the Stencil
project will be tested against each regular expression to determine if changes to the file (or directory) should trigger a project rebuild.

:::note
If you want to ignore TS files such as `.ts`/`.js` or `.tsx`/`.jsx` extensions, these files will also need to be specified in your project's tsconfig's
[`watchOptions`](https://www.typescriptlang.org/docs/handbook/configuring-watch.html#configuring-file-watching-using-a-tsconfigjson) _in addition_ to the
`watchIgnoredRegex` option. For instance, if we wanted to ignore the `my-component.tsx` file, we'd specify:

```json title="tsconfig.json"
{
...,
"watchOptions": {
"excludeFiles": ["src/components/my-component/my-component.tsx"]
}
}
```

:::

0 comments on commit 97b5c45

Please sign in to comment.