mirror of
https://github.com/ivan-94/obsidian-plugin-manushelf.git
synced 2026-07-22 08:33:19 +00:00
10 lines
354 B
JavaScript
10 lines
354 B
JavaScript
import { stat } from "node:fs/promises";
|
|
|
|
const MAX_BUNDLE_BYTES = 15 * 1024 * 1024;
|
|
const { size } = await stat("main.js");
|
|
|
|
if (size > MAX_BUNDLE_BYTES) {
|
|
throw new Error(`main.js is ${size} bytes; the self-contained plugin budget is ${MAX_BUNDLE_BYTES} bytes.`);
|
|
}
|
|
|
|
console.log(`main.js bundle: ${(size / 1024 / 1024).toFixed(2)} MiB / 15.00 MiB`);
|