mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-29 09:02:03 +00:00
fix(kit): use dst
to deduplicate templates when adding them (#29895)
This commit is contained in:
parent
64a4f0711b
commit
86a7457766
@ -22,9 +22,9 @@ export function addTemplate<T> (_template: NuxtTemplate<T> | string) {
|
|||||||
// Normalize template
|
// Normalize template
|
||||||
const template = normalizeTemplate(_template)
|
const template = normalizeTemplate(_template)
|
||||||
|
|
||||||
// Remove any existing template with the same filename
|
// Remove any existing template with the same destination path
|
||||||
nuxt.options.build.templates = nuxt.options.build.templates
|
nuxt.options.build.templates = nuxt.options.build.templates
|
||||||
.filter(p => normalizeTemplate(p).filename !== template.filename)
|
.filter(p => normalizeTemplate(p).dst !== template.dst)
|
||||||
|
|
||||||
// Add to templates array
|
// Add to templates array
|
||||||
nuxt.options.build.templates.push(template)
|
nuxt.options.build.templates.push(template)
|
||||||
|
Loading…
Reference in New Issue
Block a user