refactor: move declaration inside function

This commit is contained in:
Ayo Ayco 2024-08-03 10:46:54 +02:00
parent 3e31306fc2
commit 0bdeff20d0

View file

@ -12,11 +12,6 @@ import { randomUUID } from "node:crypto";
* @typedef {import('astro').AstroIntegration} AstroIntegration * @typedef {import('astro').AstroIntegration} AstroIntegration
*/ */
/**
* @type {Array<string>}
*/
let assets = [];
const plugin_dir = path.resolve(path.dirname('.')); const plugin_dir = path.resolve(path.dirname('.'));
/** /**
@ -32,7 +27,10 @@ export default function serviceWorker(config) {
path: serviceWorkerPath path: serviceWorkerPath
} = config; } = config;
console.log('[astro-sw] dir', plugin_dir) /**
* @type {Array<string>}
*/
let assets = [];
return { return {
'name': 'astro-sw', 'name': 'astro-sw',