Parcel: Add back `--hmr-port`

Created on 16 Sep 2020  ยท  8Comments  ยท  Source: parcel-bundler/parcel

๐Ÿ™‹ feature request

Add back a --hmr-port CLI flag.

๐Ÿค” Expected Behavior

Being able to do parcel --hmr-port 9999 index.html.

parcel --port 5555 index.html should point both HTTP server and HMR to port 5555.
The --hmr-port would override that value for HMR only.

๐Ÿ’ Possible Solution

The dev server itself should already support this. I think we just didn't add it as a CLI flag.

https://github.com/parcel-bundler/parcel/blob/52f365668013a08b8afa03e549934a6137eb9c4d/packages/core/parcel/src/cli.js#L89-L100

https://github.com/parcel-bundler/parcel/blob/52f365668013a08b8afa03e549934a6137eb9c4d/packages/core/parcel/src/cli.js#L346

Good First Issue Feature โœจ Parcel 2

All 8 comments

hi i like to work on this issue ,
i should add the --hmr-port to the hmrOptions var in parcel/packages/core/parcel/src/cli.js
am i correct

thanks you

Correct ๐Ÿ‘

thanks i will make a pr

what should be the description to this flag

'--hmr-port':'hot module replacement port'

is this appropriate

hi @mischnic

i added '--hmr-port': 'hot module replacement port', to parcel/packages/core/parcel/src/cli.js :101 file
and to debug run in parcel/simple-example in path packages/examples/simple

parcel src/index.js --port 8080 command works fine but when i add --hmr-port , parcel src/index.js --port 8080 --hmr-port 9999

port

it show errors

hrmr

is it not reading the arguments correctly .

thank you.

You need to do '--hmr-port <port>': 'hot module replacement port', so that the number following that is actually used as a HMR port and not as an entry folder.

thanks ,
now it is working

simple js example

adass

html example

hmra

but i am getting this one test failed .

tests

Open a PR with your changes, symlinks on Windows are a bit problematic - we'll see.

hi
opened pull request #5187

thank you

Was this page helpful?
0 / 5 - 0 ratings