diff --git a/core/_demo.ts b/core/_demo.ts new file mode 100644 index 0000000..4d2ba3b --- /dev/null +++ b/core/_demo.ts @@ -0,0 +1,37 @@ +import { build } from "@bundle/core"; +import { compress } from "@bundle/compress"; +import { outdent } from "@bundle/utils/outdent"; + +const result = await build({ + entryPoints: [], + esbuild: { + stdin: { + contents: outdent` + // Click Build for the Bundled, Minified & Compressed package size + export { useMigrations } from "npm:drizzle-orm/expo-sqlite/migrator"; + export { drizzle } from "npm:drizzle-orm/expo-sqlite"; + export { openDatabaseSync } from "npm:expo-sqlite"; + `, + loader: 'tsx', + resolveDir: ".", + }, + platform: "node", + } +}); + +const { content: _content, ...size } = await compress( + result.contents.map(x => x.contents as Uint8Array), +); + +console.log({ size }); +// Output: +// { +// size: { +// type: "gzip", +// rawUncompressedSize: 2535489, +// uncompressedSize: "2.54 MB", +// rawCompressedSize: 815487, +// compressedSize: "815 kB", +// size: "815 kB (gzip)" +// } +// } \ No newline at end of file