diff --git a/package.json b/package.json index a8535f98..db4b69df 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "test": "yarn lint && jest" }, "dependencies": { + "clone-deep": "^4.0.1", "defu": "^3.2.2", "execa": "^5.0.0", "fs-extra": "^9.0.1", diff --git a/src/workbox/options.ts b/src/workbox/options.ts index f53e0288..8d3b769a 100644 --- a/src/workbox/options.ts +++ b/src/workbox/options.ts @@ -1,10 +1,11 @@ import { resolve } from 'path' +import cloneDeep from 'clone-deep' import { joinUrl, getRouteParams, startCase, randomString, PKG_DIR } from '../utils' import type { WorkboxOptions, PWAContext } from '../../types' import { defaults } from './defaults' export function getOptions (nuxt, pwa: PWAContext): WorkboxOptions { - const options: WorkboxOptions = { ...defaults, ...pwa.workbox } + const options: WorkboxOptions = cloneDeep({ ...defaults, ...pwa.workbox }) // enabled if (options.enabled === undefined) {