From fc1b5b995f7bcb3c5ba293542d8d5979e81a07ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leo=20Wang=28=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7=29?= <308487730@qq.com> Date: Thu, 18 Apr 2024 14:32:14 +0800 Subject: [PATCH 1/2] feat: disable code minify during dev --- src/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.ts b/src/index.ts index 8c640ce..d919f86 100644 --- a/src/index.ts +++ b/src/index.ts @@ -116,6 +116,7 @@ export default defineNuxtModule({ config.vite.mode ??= (await viteConfigPromise).mode config.vite.build ??= {} config.vite.build.watch ??= {} + config.vite.build.minify ??= false config.vite.plugins ??= [] config.vite.plugins.push({ name: 'nuxt-electron:startup', From ccb046e5cf9e7f1514e0dadbacee61751e2eafd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leo=20Wang=28=E8=8D=89=E9=9E=8B=E6=B2=A1=E5=8F=B7=29?= <308487730@qq.com> Date: Sun, 21 Apr 2024 07:56:08 +0800 Subject: [PATCH 2/2] fix: compatible vite@4 --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index d919f86..df7106f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -125,7 +125,7 @@ export default defineNuxtModule({ config.onstart.call(this, { startup, reload() { - viteServerPromise.then(server => server.hot.send({ type: 'full-reload' })) + viteServerPromise.then(server => (server.hot || server.ws).send({ type: 'full-reload' })) }, }) } else {