Parcel 2: `parcel watch` doesn't respect `--cert` or `--key` flags
#4485 opened on Apr 16, 2020
Description
🐛 bug report
parcel watch doesn't appear to use the --cert or --key flags, though its help output states it supports them. I don't know that the --https flag is affecting anything either.
Not sure if this is related to the recent work done in #4417.
🤔 Expected Behavior
$ parcel serve --cert cert.pem --key key.pem index.html
$ parcel watch --cert cert.pem --key key.pem index.html
Both of the above commands should result in an HMR server starting up on the default port, in "HTTPS mode", using the specified cert and private key.
😯 Current Behavior
When running the following:
$ parcel serve --cert cert.pem --key key.pem index.html
Parcel starts up an HTTPS HMR server on port 1234 using the certificate and private key specified.
parcel watch also states it supports the --cert and --key flags. However, when running the following:
$ parcel watch --cert cert.pem --key key.pem index.html
A non-HTTPS HMR server is started up.
💁 Possible Solution
🔦 Context
Being able to specify a custom cert for watch is beneficial in the same ways it is for build. For example, it lets one setup local environments testing with E2E TLS encryption, while still allowing the convenience of Parcel's great HMR support.
🌍 Your Environment
| Software | Version(s) |
|---|---|
| Parcel | 2.0.0-nightly.220 |
| Node | 12.16.2 |
| npm/Yarn | Yarn 1.22.0 |
| Operating System | macOS 10.15.4 |