chore(nuxt): prefer structuredClone

This commit is contained in:
Julien Huang 2024-12-07 19:50:58 +01:00
parent 2cd9f33e6d
commit 4678501953

View File

@ -33,7 +33,7 @@ export default defineNuxtModule<Partial<ImportsOptions>>({
}), }),
async setup (options, nuxt) { async setup (options, nuxt) {
// TODO: fix sharing of defaults between invocations of modules // TODO: fix sharing of defaults between invocations of modules
const presets = JSON.parse(JSON.stringify(options.presets)) as ImportPresetWithDeprecation[] const presets = structuredClone(options.presets as ImportPresetWithDeprecation[])
// Allow modules extending sources // Allow modules extending sources
await nuxt.callHook('imports:sources', presets) await nuxt.callHook('imports:sources', presets)