mirror of
https://github.com/outline/outline.git
synced 2025-12-30 07:19:52 -06:00
* Upgrade @typescript-eslint dependencies from v6.21.0 to v8.33.0 - Updated @typescript-eslint/eslint-plugin from ^6.21.0 to ^8.33.0 - Updated @typescript-eslint/parser from ^6.21.0 to ^8.33.0 - Tested linting functionality to ensure compatibility - This brings the latest TypeScript ESLint features and bug fixes * lint * tsc --------- Co-authored-by: codegen-sh[bot] <131295404+codegen-sh[bot]@users.noreply.github.com> Co-authored-by: Tom Moor <tom@getoutline.com>
31 lines
721 B
TypeScript
31 lines
721 B
TypeScript
import fs from "fs";
|
|
import path from "path";
|
|
import Logger from "@server/logging/Logger";
|
|
|
|
export type Chunk = {
|
|
file: string;
|
|
imports: string[];
|
|
src: string;
|
|
isEntry?: boolean;
|
|
};
|
|
|
|
export type ManifestStructure = Record<string, Chunk>;
|
|
|
|
export const readManifestFile = (file = "./build/app/.vite/manifest.json") => {
|
|
const absoluteFilePath = path.resolve(file);
|
|
|
|
let manifest = "{}";
|
|
|
|
try {
|
|
manifest = fs.readFileSync(absoluteFilePath, "utf8") as string;
|
|
} catch (_err) {
|
|
Logger.warn(
|
|
`Can not find ${absoluteFilePath}. Try executing "yarn vite:build" before running in production mode.`
|
|
);
|
|
}
|
|
|
|
return JSON.parse(manifest) as ManifestStructure;
|
|
};
|
|
|
|
export default readManifestFile;
|