Skip to content

Commit 5db6a47

Browse files
committed
fix mkdir error?
1 parent fe4a13c commit 5db6a47

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mdx.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import yaml from 'js-yaml';
44
import {bundleMDX} from 'mdx-bundler';
55
import {BinaryLike, createHash} from 'node:crypto';
66
import {createReadStream, createWriteStream, mkdirSync} from 'node:fs';
7-
import {access, cp, opendir, readFile} from 'node:fs/promises';
7+
import {access, cp, mkdir, opendir, readFile} from 'node:fs/promises';
88
import path from 'node:path';
99
// @ts-expect-error ts(2305) -- For some reason "compose" is not recognized in the types
1010
import {compose, Readable} from 'node:stream';
@@ -630,7 +630,6 @@ export async function getFileBySlug(slug: string): Promise<SlugFile> {
630630
// inline svgs
631631
'.svg': 'dataurl',
632632
};
633-
options.metafile = true;
634633
// Set the `outdir` to a public location for this bundle.
635634
// this where this images will be copied
636635
options.outdir = assetsCacheDir;
@@ -663,6 +662,7 @@ export async function getFileBySlug(slug: string): Promise<SlugFile> {
663662
},
664663
};
665664

665+
await mkdir(outdir, {recursive: true});
666666
await cp(assetsCacheDir, outdir, {
667667
recursive: true,
668668
errorOnExist: false,

0 commit comments

Comments
 (0)