Closed quantuminformation closed 4 months ago
Seeing this too. Even when watching just one file. In my case it is a file in node_modules
Same behaviour for me, no error when running the watch script, but no rerun of my script
My bad, i finally made it work !
This tool uses nodemon under the hood and nodemon, by default, only triggers on .js
, .mjs
, .coffee
, .litcoffee
, and .json
. My package.json configuration is this:
{
...
"watch": {
"run_dev": {
"patterns": [
"src",
"public"
],
"extensions": [
"css",
"d",
"js",
"json",
"png",
"svg",
"ts"
]
}
}
I got the list of extensions for my public and src directory like this:
ls src/* public/* | cut -d. -f2 | sort -u
Slightly out of date as to what the defaults of nodemon are, but please set the patterns
and extensions
keys in order to watch non-default file types
If you need to watch files with extensions other than those that nodemon watches by default (.js, .coffee, .litcoffee), you can set the value to an object with patterns and extensions keys. You can also add an ignore key (a list or a string) to ignore specific files. Finally, you can add a quiet flag to hide the script name in any output on stdout or stderr, or you can use the inherit flag to preserve the original's process stdout or stderr. You can enable nodemon legacy watch and specify the restart delay in milliseconds with the corresponding flags.
I have this npm script:
"dev": "cross-env NODE_ENV=development npm run build:i18n:dev && vite",
I want this script to stop and rerun if my src/i18n dir has a file change:
I tried:
but when I change src/i18n/en.ts I don't get what I want