Skip to content

closeWatcher is not called on SIGINT (Ctrl + C) #5615

@m59peacemaker

Description

@m59peacemaker

Expected Behavior / Situation

It seems appropriate for rollup -w to add a SIGINT handler in which watcher.close() is called, triggering closeWatcher hooks, so that plugins that have need of closeWatcher can properly clean up.

Actual Behavior / Situation

The closeWatcher hook is not called when the process from rollup -w is killed with SIGINT (e.g. via Ctrl + C).

Modification Proposal

Simply add a process.on('SIGINT', handler) in the cli handler for rollup -w to gracefully close the watcher so that closeWatcher hooks are called.

I can likely prepare this PR if desirable.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions