vite-plugin-react-server
Version:
Vite plugin for React Server Components (RSC)
33 lines (30 loc) • 684 B
JavaScript
/**
* vite-plugin-react-server
* Copyright (c) Nico Brinkkemper
* MIT License
*/
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
function tryManifest(options) {
const manifestPath = resolve(
options.root,
options.outDir,
".vite",
options.ssrManifest ? "ssr-manifest.json" : "manifest.json"
);
try {
const result = JSON.parse(readFileSync(manifestPath, "utf-8"));
return {
type: "success",
manifest: result
};
} catch (e) {
console.log("No manifest found", manifestPath);
return {
type: "error",
error: e
};
}
}
export { tryManifest };
//# sourceMappingURL=tryManifest.js.map