Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kfrederix authored Nov 26, 2020
1 parent 3cde056 commit 63479c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/partialHydration/prepareFindSvelteComponent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand All @@ -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)));
Expand Down

0 comments on commit 63479c7

Please sign in to comment.