mirror of
https://github.com/socketio/socket.io.git
synced 2026-01-11 16:08:24 -05:00
18 lines
468 B
JavaScript
18 lines
468 B
JavaScript
import { rollup } from "rollup";
|
|
import terser from "@rollup/plugin-terser";
|
|
import { brotliCompressSync } from "node:zlib";
|
|
|
|
const rollupBuild = await rollup({
|
|
input: "./src/index.js"
|
|
});
|
|
|
|
const rollupOutput = await rollupBuild.generate({
|
|
format: "esm",
|
|
plugins: [terser()],
|
|
});
|
|
|
|
const bundleAsString = rollupOutput.output[0].code;
|
|
const brotliedBundle = brotliCompressSync(Buffer.from(bundleAsString));
|
|
|
|
console.log(`Bundle size: ${brotliedBundle.length} B`);
|