From 79e7565a65e79c3a41ce21b768c8f3c52fab1086 Mon Sep 17 00:00:00 2001 From: Enzo Innocenzi Date: Sat, 10 Jul 2021 17:49:55 +0200 Subject: [PATCH] feat(npm): auto configure HMR --- npm/src/index.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/npm/src/index.ts b/npm/src/index.ts index ce554db..b37c485 100644 --- a/npm/src/index.ts +++ b/npm/src/index.ts @@ -93,13 +93,17 @@ export class ViteConfiguration { host: host.substr(2), https: protocol === 'https', port: port ? Number(port) : 3000, + hmr: { + host: host.substr(2), + port: Number(port) || 3000, + }, } - } - if (artisan?.entrypoints) - (this.build.rollupOptions!.input! as string[]).push(...artisan.entrypoints) + if (artisan?.entrypoints) + (this.build.rollupOptions!.input! as string[]).push(...artisan.entrypoints) - this.merge(config) + this.merge(config) + } } /**