From 2cb831ab1c764e693f9cfc0b1eabcba463917c1b Mon Sep 17 00:00:00 2001 From: Krisjanis Seglins Date: Thu, 14 Nov 2024 10:22:04 +0200 Subject: [PATCH] Add Vite variable for determining service worker context Fixes https://github.com/vaadin/hilla/issues/2867 --- flow-server/src/main/resources/vite.generated.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/flow-server/src/main/resources/vite.generated.ts b/flow-server/src/main/resources/vite.generated.ts index 7d323d8a9bc..94644e78438 100644 --- a/flow-server/src/main/resources/vite.generated.ts +++ b/flow-server/src/main/resources/vite.generated.ts @@ -145,6 +145,7 @@ function buildSWPlugin(opts: { devMode: boolean }): PluginOption { replace({ values: { 'process.env.NODE_ENV': JSON.stringify(config.mode), + 'process.env.VITE_SW_CONTEXT': true, ...config.define }, preventAssignment: true