Skip to content

Commit e94d66f

Browse files
committed
Fixed error in svelte.config.js caused by recent update
1 parent 30b7ca0 commit e94d66f

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

svelte.config.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,15 @@
22
import adapter from "@sveltejs/adapter-static";
33
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
44
import { mdsvex } from "mdsvex";
5+
import path from "path";
56
import classNames from "rehype-class-names";
67
import rehypeTitleFigure from "rehype-title-figure";
78
import smartypants from "remark-smartypants";
8-
import { visit } from "unist-util-visit";
9+
import visit from "unist-util-visit";
10+
import { fileURLToPath } from "url";
11+
12+
const __filename = fileURLToPath(import.meta.url);
13+
const __dirname = path.dirname(__filename);
914

1015
const classNamesOptions = {
1116
h2: "section",
@@ -170,7 +175,7 @@ const mdsvexOptions = {
170175
remarkPlugins: [smartypants, escapeQuotes, processMetadata, blogImages],
171176
rehypePlugins: [rehypeTitleFigure, [classNames, classNamesOptions]],
172177
layout: {
173-
blog: "src/lib/blocks/Post.svelte",
178+
blog: path.resolve(__dirname, "src/lib/blocks/Post.svelte"),
174179
},
175180
};
176181

0 commit comments

Comments
 (0)