fix(nuxt3): don't double-escape extensions (#2953)

This commit is contained in:
Daniel Roe 2022-01-27 16:02:25 +00:00 committed by GitHub
parent d20b672546
commit 8ea6b652b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'