mirror of
https://github.com/actualbudget/actual.git
synced 2026-04-30 18:00:06 -05:00
🐛 Fix to show the notification for updating service worker (#5963)
* Fix to show the notification for updating service worker * cleanup * Add release notes for PR #5963 * trigger pipeline --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@@ -28,7 +28,6 @@ const fileList = new Map<string, string>();
|
||||
// Log installation event
|
||||
self.addEventListener('install', (_event: ExtendableEvent) => {
|
||||
console.log('Plugins Worker installing...');
|
||||
self.skipWaiting(); // Forces activation immediately
|
||||
});
|
||||
|
||||
// Log activation event
|
||||
@@ -64,6 +63,8 @@ self.addEventListener('fetch', (event: FetchEvent) => {
|
||||
? pathSegments[slugIndex + 1].split('?')[0]
|
||||
: '';
|
||||
event.respondWith(handlePlugin(slug, fileName.replace('?import', '')));
|
||||
} else {
|
||||
event.respondWith(fetch(event.request));
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import { defineConfig } from 'vite';
|
||||
export default defineConfig(({ mode }) => {
|
||||
const isDev = mode === 'development';
|
||||
const outDir = path.resolve(__dirname, 'dist');
|
||||
const buildHash = Date.now().toString(36);
|
||||
|
||||
return {
|
||||
mode,
|
||||
@@ -18,8 +17,7 @@ export default defineConfig(({ mode }) => {
|
||||
entry: path.resolve(__dirname, 'src/plugin-service-worker.ts'),
|
||||
name: 'plugin_sw',
|
||||
formats: ['iife'],
|
||||
fileName: () =>
|
||||
isDev ? `plugin-sw.dev.js` : `plugin-sw.${buildHash}.js`,
|
||||
fileName: () => `plugin-sw.js`,
|
||||
},
|
||||
sourcemap: true,
|
||||
minify: isDev ? false : 'terser',
|
||||
|
||||
Reference in New Issue
Block a user