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

cwd is always watched for reload although path is passed #64

Open
devgar opened this issue Jan 22, 2018 · 3 comments
Open

cwd is always watched for reload although path is passed #64

devgar opened this issue Jan 22, 2018 · 3 comments

Comments

@devgar
Copy link

devgar commented Jan 22, 2018

I was expecting that launching micro-dev api will only watch 'api' folder but it is reloading after any file on my project changes, also outside api folder.

I have solved that using --ignore flag but I find the behavior that I expected more rational.

@tungv
Copy link
Contributor

tungv commented Jan 22, 2018

micro-dev CLI expect a file instead (it will attempt to resolve index.js file if you give a folder, the same way require resolves paths).

To watch a specific folder, you can use --watch or -w

@devgar
Copy link
Author

devgar commented Jan 22, 2018

Thanks, you have solved my problem.
I was confused about --watch usage, --help says:

    -w, --watch <dir>   A directory to watch in addition to [path]

@tungv
Copy link
Contributor

tungv commented Jan 22, 2018

I think the help text is almost correct. the [path] is always watched. in your situation, [path] === api/index.js. I think the missing piece in the help is that it should say "if watch is not set, micro-dev will watch your cwd".

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

No branches or pull requests

2 participants