From 63479c71844022e241bc94be3290cfda6af203f7 Mon Sep 17 00:00:00 2001 From: Karel Frederix Date: Thu, 26 Nov 2020 16:17:49 +0100 Subject: [PATCH] fix tests --- src/partialHydration/prepareFindSvelteComponent.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/partialHydration/prepareFindSvelteComponent.ts b/src/partialHydration/prepareFindSvelteComponent.ts index f9d5809e..ff7e890b 100644 --- a/src/partialHydration/prepareFindSvelteComponent.ts +++ b/src/partialHydration/prepareFindSvelteComponent.ts @@ -14,7 +14,7 @@ export const removeHash = (pathWithHash) => { }; const prepareFindSvelteComponent = ({ ssrFolder, rootDir, clientComponents: clientFolder, distDir }) => { - const rootDirPlusSrc = windowsPathFix(path.join(rootDir, 'src')); + const rootDirFixed = windowsPathFix(rootDir); const ssrComponents = glob.sync(`${ssrFolder}/**/*.js`); const clientComponents = glob .sync(`${clientFolder}/**/*.js`) @@ -27,8 +27,8 @@ const prepareFindSvelteComponent = ({ ssrFolder, rootDir, clientComponents: clie if (cache.has(cacheKey)) return cache.get(cacheKey); // abs path first - if (name.includes(rootDirPlusSrc)) { - const rel = windowsPathFix(path.relative(rootDirPlusSrc, name)).replace('.svelte', '.js'); + if (name.includes(rootDirFixed)) { + const rel = windowsPathFix(path.relative(path.join(rootDirFixed, 'src'), name)).replace('.svelte', '.js'); const parsed = path.parse(rel); const ssr = ssrComponents.find((c) => c.endsWith(rel)); const client = windowsPathFix(clientComponents.find((c) => removeHash(c).endsWith(rel)));