Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nuxt): include plugin templates in plugins.d.ts if they will be written #23943

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/nuxt/src/core/templates.ts
Expand Up @@ -103,7 +103,7 @@ export const pluginsDeclaration: NuxtTemplate<TemplateContext> = {
getContents: (ctx) => {
const EXTENSION_RE = new RegExp(`(?<=\\w)(${ctx.nuxt.options.extensions.map(e => escapeRE(e)).join('|')})$`, 'g')
const tsImports = ctx.app.plugins
.filter(p => !isAbsolute(p.src) || existsSync(p.src) || existsSync(p.src.replace(EXTENSION_RE, '.d.ts')))
.filter(p => !isAbsolute(p.src) || existsSync(p.src) || (p.src.includes('.d.ts') && existsSync(p.src.replace(EXTENSION_RE, '.d.ts'))))
danielroe marked this conversation as resolved.
Show resolved Hide resolved
danielroe marked this conversation as resolved.
Show resolved Hide resolved
.map(p => (isAbsolute(p.src) ? relative(join(ctx.nuxt.options.buildDir, 'types'), p.src) : p.src).replace(EXTENSION_RE, ''))

return `// Generated by Nuxt'
Expand Down