@aravindc26/velu 0.12.4 → 0.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cli.ts +7 -1
package/package.json
CHANGED
package/src/cli.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { resolve, join, dirname, delimiter } from "node:path";
|
|
2
|
-
import { existsSync, mkdirSync, writeFileSync, readdirSync, copyFileSync, rmSync, readFileSync, statSync } from "node:fs";
|
|
2
|
+
import { existsSync, mkdirSync, writeFileSync, readdirSync, copyFileSync, rmSync, readFileSync, statSync, symlinkSync } from "node:fs";
|
|
3
3
|
import { spawn } from "node:child_process";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { tmpdir } from "node:os";
|
|
@@ -511,6 +511,12 @@ async function previewServer(port: number) {
|
|
|
511
511
|
try { rmSync(runtimeDir, { recursive: true, force: true }); } catch {}
|
|
512
512
|
copyDirMerge(PREVIEW_ENGINE_DIR, runtimeDir);
|
|
513
513
|
|
|
514
|
+
// Symlink node_modules so Next.js can resolve dependencies (fumadocs-mdx, etc.)
|
|
515
|
+
const runtimeNodeModules = join(runtimeDir, "node_modules");
|
|
516
|
+
if (!existsSync(runtimeNodeModules)) {
|
|
517
|
+
symlinkSync(NODE_MODULES_PATH, runtimeNodeModules);
|
|
518
|
+
}
|
|
519
|
+
|
|
514
520
|
console.log(` Starting preview server on port ${port}...`);
|
|
515
521
|
console.log(` Preview content dir: ${process.env.PREVIEW_CONTENT_DIR || "(default)"}`);
|
|
516
522
|
console.log(` Workspace dir: ${process.env.WORKSPACE_DIR || "(default)"}`);
|