mirror of
https://github.com/outline/outline.git
synced 2026-12-04 10:24:43 +03:00
25 lines
499 B
TypeScript
25 lines
499 B
TypeScript
import fs from "fs";
|
|
import path from "path";
|
|
|
|
type Chunk = {
|
|
file: string;
|
|
src: string;
|
|
isEntry?: boolean;
|
|
};
|
|
|
|
type ManifestStructure = Record<string, Chunk>;
|
|
|
|
const file = path.resolve("./build/app/manifest.json");
|
|
|
|
let manifest = "{}";
|
|
|
|
try {
|
|
manifest = fs.readFileSync(file, "utf8") as string;
|
|
} catch (err) {
|
|
console.warn(
|
|
`Can not find ${file}. Try executing "yarn vite:build" before running in production mode.`
|
|
);
|
|
}
|
|
|
|
export default JSON.parse(manifest) as ManifestStructure;
|