Open Kogia-sima opened 5 years ago
I would like to work on this but, how it is possible to execute window.close();
from the server side?
I'm not really convinced this is a helpful feature (would be rather unexpected).
Regarding implementation: The HMR server would need to emit a new event type ("close?") and the hmr runtime would then execute window.close
: https://github.com/parcel-bundler/parcel/blob/ee0acf2a384c39ff8d04bcb66c8acd60a79edf22/packages/core/parcel-bundler/src/builtins/hmr-runtime.js#L67
AH, I got it Thanks! I will try to submit PR :)
This could only be a helpful feature if provided as an option and not a default, e.g. --autoclose
🙋 feature request
Parcel CLI has an option '--open' which enables to opens bundled file with a browser automatically. However, if you stopped the HMR server with Ctrl + C, that tab does not close automatically, and then you have to close the tab manually.
🤔 Expected Behavior
When the websocket to the HMR server has disconnected, current browser tab closes automatically.
😯 Current Behavior
Browser tab remains and you have to close it manually.
💁 Possible Solution
See the implementation of suan/instant-markdown-d
🔦 Context
💻 Examples
And press Ctrl + C. You can see the browser tab opened by parcel command does not close automatically.