diff --git a/src/cli/commands/dev.ts b/src/cli/commands/dev.ts index 3de8984..bc2f97e 100644 --- a/src/cli/commands/dev.ts +++ b/src/cli/commands/dev.ts @@ -5,20 +5,21 @@ import { existsSync, promises as fs, watch } from "fs"; import * as http from "http"; +import * as net from "net"; import * as path from "path"; import { renderSite } from "../../build"; import { Config, loadConfig } from "../../config"; import { Command, UsageError } from "../types"; -const SERVER_PORT = 8080; +const DEFAULT_SERVER_PORT = 8080; -const injectLiveReloadScript = (htmlContents: string): string => +const injectLiveReloadScript = (htmlContents: string, port: number): string => htmlContents.replace( "", `