Needle Engine

Changes between version 3.37.9-alpha and 3.37.9-alpha.1
Files changed (1) hide show
  1. plugins/vite/pwa.js +4 -4
plugins/vite/pwa.js CHANGED
@@ -15,6 +15,10 @@
15
15
  // @ts-ignore // TODO correctly type the userSettings.pwaOptions object
16
16
  /** @type {import("vite-plugin-pwa").VitePWAOptions} */
17
17
  const pwaOptions = userSettings.pwaOptions;
18
+
19
+ /** The context contains files that are generated by the plugin and should be deleted after
20
+ * @type {import('../types').NeedlePWAProcessContext} */
21
+ const context = { generatedFiles: [] }
18
22
 
19
23
  if (!pwaOptions) {
20
24
  log("WARN: No PWA options found in user settings. Please pass in the pwaOptions to the needlePlugin like so: \"needlePlugins(command, needleConfig, { pwaOptions: PWAOptions })\" and pass the same options to vitePWA plugin like so \"VitePWA(PWAOptions)\"");
@@ -32,10 +36,6 @@
32
36
  // If gzip is wanted, the server should serve files with gzip compression on the fly.
33
37
  if (config) config.gzip = false;
34
38
 
35
- /** The context contains files that are generated by the plugin and should be deleted after
36
- * @type {import('../types').NeedlePWAProcessContext} */
37
- const context = { generatedFiles: [] }
38
-
39
39
  if (!pwaOptions.registerType) {
40
40
  log("Set PWA registerType to autoUpdate. This will automatically update the service worker when the content changes. If you want to manually update the service worker set the registerType to manual. See https://vite-pwa-org.netlify.app/guide/#configuring-vite-plugin-pwa");
41
41
  pwaOptions.registerType = "autoUpdate";