From 296f20a5441b88c85da964edd140f08db0f74091 Mon Sep 17 00:00:00 2001 From: Connor Pearson Date: Fri, 3 Nov 2023 11:13:19 +0100 Subject: [PATCH] fix: always include vue extension in SFC content paths (#752) --- src/resolvers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/resolvers.ts b/src/resolvers.ts index 8e231de4..23f4c8ee 100644 --- a/src/resolvers.ts +++ b/src/resolvers.ts @@ -28,7 +28,8 @@ export const resolveContentPaths = (srcDir: string, nuxt = useNuxt()) => { const extensionFormat = (s: string[]) => s.length > 1 ? `.{${s.join(',')}}` : `.${s.join('') || 'vue'}` const defaultExtensions = extensionFormat(['js', 'ts', 'mjs']) - const sfcExtensions = extensionFormat(nuxt.options.extensions.map(e => e.replace(/^\.*/, ''))) + const extensions = Array.from(new Set(['vue', ...nuxt.options.extensions])) + const sfcExtensions = extensionFormat(Array.from(new Set(['vue', ...nuxt.options.extensions])).map(e => e.replace(/^\.*/, ''))) const importDirs = [...(nuxt.options.imports?.dirs || [])].map(r) const [composablesDir, utilsDir] = [resolve(srcDir, 'composables'), resolve(srcDir, 'utils')]