Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --hmr-host option to set HMR host #8101

Merged
merged 2 commits into from May 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/core/parcel/src/cli.js
Expand Up @@ -116,6 +116,7 @@ var hmrOptions = {
'--cert <path>': 'path to certificate to use with HTTPS',
'--key <path>': 'path to private key to use with HTTPS',
'--hmr-port <port>': ['hot module replacement port', process.env.HMR_PORT],
'--hmr-host <host>': ['hot module replacement host', process.env.HMR_HOST],
};

function applyOptions(cmd, options) {
Expand Down Expand Up @@ -446,8 +447,9 @@ async function normalizeOptions(
let hmrOptions = null;
if (command.name() !== 'build' && command.hmr !== false) {
let hmrport = command.hmrPort ? parsePort(command.hmrPort) : port;
let hmrhost = command.hmrHost ? command.hmrHost : host;

hmrOptions = {port: hmrport, host};
hmrOptions = {port: hmrport, host: hmrhost};
}

if (command.detailedReport === true) {
Expand Down