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 a "watch" command #880

Open
Jujulego opened this issue Nov 11, 2023 · 3 comments
Open

Add a "watch" command #880

Jujulego opened this issue Nov 11, 2023 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Jujulego
Copy link
Owner

The idea is to behave like the "run" command, but instead of ending when all task are done, this should watch over input files, and retrigger tasks affected by detected changes, and then retrigger dependent tasks.

Problems:

  • Detecting "input files" in a generic way, to keep configuration to a minimum
  • Supporting "watch modes". Many build tools (tsc, webpack, vite, rollup, etc...) already have a watch ability, providing optimizations (not rebuild all files) and dev friendly functionalities (hot reload):
    • Detect those tools (maybe use the "watch" script if available and fallback to "build" script)
    • Detect when they end their work, to trigger dependent tasks. Retriggering them should not be needed as they should watch over output of previous task
@Jujulego Jujulego added enhancement New feature or request help wanted Extra attention is needed labels Nov 11, 2023
@Jujulego
Copy link
Owner Author

To detect : use .gitignore file => all that is not ignored might be a source file + override by a property in workspace's package.json

@Jujulego
Copy link
Owner Author

Rollup integration (and vite) : can develop a plugin, using buildStart & buildEnd to monitor rollup build state.

buildStart can return a Promise (might allow to control start if rollup waits for it to resolve)

Rollup plugin doc

@Jujulego
Copy link
Owner Author

Webpack integration : can develop a plugin, using beforeRun & done to monitor webpack state.

beforeRun is async & serial => might allow to control compilation start

Webpack compile hooks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant