UNPKG

rollup-plugin-webpack-stats

Version:

Rollup/Vite/Rolldown plugin to generate a stats JSON file with a bundle-stats webpack-compatible structure

17 lines (15 loc) 394 B
import path from "node:path"; import fs from "node:fs/promises"; //#region src/write.ts async function statsWrite(filepath, stats) { const content = JSON.stringify(stats, null, 2); await fs.mkdir(path.dirname(filepath), { recursive: true }); await fs.writeFile(filepath, content); return { filepath, content }; } //#endregion export { statsWrite }; //# sourceMappingURL=write.mjs.map