Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add filters to nodewatch #123

Open
lennyAiko opened this issue Nov 15, 2024 · 2 comments
Open

Add filters to nodewatch #123

lennyAiko opened this issue Nov 15, 2024 · 2 comments

Comments

@lennyAiko
Copy link
Contributor

lennyAiko commented Nov 15, 2024

Description

We don't want the server to restart for all files especially files in assets since we are utilizing HMR.

Current behavior

Restarts the server when we edit files in the assets folder.

Expected behavior

Since we are utilizing HMR, files in the assets folder should not be watched.

Replace space in square bracket with x e.g [x]

[x] I have checked and this issue does not exist

@lennyAiko
Copy link
Contributor Author

lennyAiko commented Nov 19, 2024

Hi @DominusKelvin since node --watch functionality does not directly support configuration files, we either have to use incline config to watch or ignore folders.

Something like this to ignore:

{
    "dev": "node --watch --ignore node_modules --ignore assets app.js",
}

If we are to watch specific folders, then something like this

{
    "dev": "node --watch --watch-path=api --watch-path=config app.js",
}

My thoughts? Watching specific folders would work best for this use case.

What's your take on this? also, is it cool if I make a PR for this? depending on the course of action you choose.

@lennyAiko
Copy link
Contributor Author

After much research, node --watch does not support the ignore functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant