Menu

1 / 2

Shipping a 4 MB level pack

DEV Community: capacitor·Othmane ETTAIB·1 day ago
#lEKOUdrX
#devtocapacitor#devto#dev#pack#build
Reading 0:00
15s threshold

Originally published on indiecore.net .

Part 6 of 10 on building a word-block puzzle engine. Part 5: the opening layout.

The level pack is 395 JSON files: 392 boards, a catalogue, an index, and a build record. On disk

in the repo it is 4.37 MB , and every byte of that was in the app I first put on the store.

None of it needed to be.

Pretty in the repo, minified in the store

The boards come out of the generator pretty-printed, and they should. They are reviewed in pull

requests, diffed when the generator changes, and read by hand when a board plays wrong. A

minified 11 KB board file is not something anyone can look at.

But nothing reads that whitespace at runtime. It is 45% of the pack :

stage pack 4.37 MB -> 2.36 MB

Enter fullscreen mode

Exit fullscreen mode

So the shrink happens on the way into the build output, never in public/ .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.