From 8ea6b652b94a449668a1a27b453bb4f161a26afe Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Thu, 27 Jan 2022 16:02:25 +0000 Subject: [PATCH] fix(nuxt3): don't double-escape extensions (#2953) --- packages/nuxt3/src/core/templates.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nuxt3/src/core/templates.ts b/packages/nuxt3/src/core/templates.ts index 41b58491a2..4b75f907e3 100644 --- a/packages/nuxt3/src/core/templates.ts +++ b/packages/nuxt3/src/core/templates.ts @@ -95,7 +95,7 @@ export const pluginsDeclaration = { filename: 'plugins.d.ts', write: true, getContents: (ctx: TemplateContext) => { - const EXTENSION_RE = new RegExp(`(?<=\\w)(${ctx.nuxt.options.extensions.map(e => `\\${escapeRE(e)}`).join('|')})$`, 'g') + const EXTENSION_RE = new RegExp(`(?<=\\w)(${ctx.nuxt.options.extensions.map(e => escapeRE(e)).join('|')})$`, 'g') const tsImports = ctx.app.plugins.map(p => relative(ctx.nuxt.options.buildDir, p.src).replace(EXTENSION_RE, '')) return `// Generated by Nuxt3'