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

fix hmr engine reference in dev #495

Merged
merged 1 commit into from Jun 15, 2020
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
7 changes: 3 additions & 4 deletions src/commands/dev.ts
Expand Up @@ -200,10 +200,6 @@ export async function command(commandOptions: CommandOptions) {
const messageBus = new EventEmitter();
const mountedDirectories: [string, string][] = [];

onProcessExit(() => {
hmrEngine.disconnectAllClients();
});

console.log = (...args) => {
messageBus.emit('CONSOLE', {level: 'log', args});
};
Expand Down Expand Up @@ -871,6 +867,9 @@ export async function command(commandOptions: CommandOptions) {
.listen(port);

const hmrEngine = new EsmHmrEngine({server});
onProcessExit(() => {
hmrEngine.disconnectAllClients();
});

// Live Reload + File System Watching
let isLiveReloadPaused = false;
Expand Down