bug: watchIgnoredRegex is not respected during stencil build --watch
#5709
Labels
Bug: Validated
This PR or Issue is verified to be a bug within Stencil
Prerequisites
Stencil Version
4.17.1
Current Behavior
Stencil has an undocumented config flag called
watchIgnoredRegex
(source). The JSDoc implies that we should be able to run the build task with--watch
and "ignore" files that are matched by this regex. However, that doesn't seem to be the case in some of my testing.When adding
watchIgnoredRegex
to my Stencil config (from a Component Starter):I would expect any files matching that regex to be ignored for something like
/private/tmp/watch-ignore-test/src/components/my-component/my-component.stories.ts
. The screenshot below is just a quick check on the regex itself, and shows the file name getting matched by the regex we use in the stencil config diff above:However, if I create a file,
src/components/my-component/my-component.stories.ts
with any valid TypeScript in it, then start the build task with watchers enabled, changing that file results in a re-renderExpected Behavior
I would expect that file to be ignored, and a compilation to stop if that was the only file being changed/updated
System Info
Steps to Reproduce
npm init stencil@latest component watch-test
cd watch-test
npm i
ignoreWatchedRegex
to your Stencil config file (root levelstencil.config.ts
)src/components/my-component/my-component.stories.ts
with:npm start
, which runs the build task with--watch
and--serve
src/components/my-component/my-component.stories.ts
in some way to be still valid TS. E.g.Code Reproduction URL
https://github.com/rwaskiewicz/stencil-5709-repro
Additional Information
I also tested this on v4.0.0, presumably it broke before then (although I didn't try every version between that and v4.17.1)
Discord thread that started this https://discord.com/channels/520266681499779082/1230541824750387271/1230541824750387271
The text was updated successfully, but these errors were encountered: