mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
fix(kit): use dst
to deduplicate templates when adding them (#29895)
This commit is contained in:
parent
82dc24ec0b
commit
d5494c9a5a
@ -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