Would love to have https support in my local development.
webpack-dev-server supports it via the "--https" flag. all the self-signing ca/key stuff is happening behind the scenes.
I did some digging into the webpack-server-code and think we could even shamelessly copy most of the necessary code over to parcel.
Would you consider this as a PR?
No need to copy webpack code this has already been done and is currently in a PR #161
For folks coming here via search: https://parceljs.org/cli.html#enable-https
Enable https
Default: https disabled
Available in: serve, watch (listen on HTTPS for HMR connections)
parcel build entry.js --https
鈿狅笍 This flag generates a self-signed certificate, you might have to configure your browser to allow self-signed certificates for localhost.
still need to add localhost to the altName
array, as by default --open
flag opens the development preview at https://localhost:1234
and chrome flags this as insecure.
Suggested fix in the parcel/src/utils/generateCertificate.js
:
altNames: [
{
type: 6, // URI
value: 'http://example.org/webid#me'
},
{
type: 7, // IP
ip: '127.0.0.1'
},
{
type: 8,
value: `localhost`
}
]
Most helpful comment
For folks coming here via search: https://parceljs.org/cli.html#enable-https