Skip to content

Add --watch option #3

@jaridmargolin

Description

@jaridmargolin

Pending #2, "Allow for inspect specific options", a watch feature could be implemented.

Requirements

I see three core requirements for the implementation:

1. Ease of Use

There should be no need for config files, env vars, globs, or directory paths. The command should be as simple as setting the --watch flag.

After some initial research this seems completely realistic. Under the hood browserify uses a module (also written by substack) module-deps. Currently I am uncertain if I would work with module-deps directly or if I would leverage the functionality built into browserify.

There is a solid example of utilzing browserify here in the watchify src.

2. Development Speed

Closing and launching the browser is a time consuming task. A preferable strategy would be to "reset", or "restart", the existing devtools session.

3. Minimize Moving Parts

Besides the required time to launch browser on file change, we also want to minimize developer frustration, by respecting any manual adjustments applied to the window placement and size. Closing the browser would result in clearing the state of these manual changes. The only way to ensure consistent behavior is again, to "reset", or "restart", the existing devtools session on change.

Additional Notes

chokidar has an issue, "watching directory with name including glob characters". Specifically this is known to cause issues seen when a user works within a Dropbox folder.

Can follow progress:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions