shaktiman_droid
03/03/2022, 1:18 AMjsBrowserDistribution
where we get a fat .js
file.
Here is the output for this for my sample project
shared.js => 122KB
shared.js.map => 49KB
• Another option is to ship library as an NPM module. For example @Big Chungus’s plugin task `packJsNpmPublication`provides output like this for same sample project
npm notice === Tarball Contents ===
npm notice 316.8kB Kmp_Library-shared.js
npm notice 117B package.json
npm notice 71.7kB Kmp_Library-shared.js.map
npm notice 715B Kmp_Library-shared.d.ts
npm notice === Tarball Details ===
npm notice name: shared
npm notice version: 0.1.0
npm notice filename: shared-0.1.0.tgz
npm notice package size: 74.5 kB
npm notice unpacked size: 389.3 kB
# Which number to believe from both options?
Now for example if I want to add kotlinx.datetime
dependency in my project
I want to measure how much size impact it would do to my library user.Big Chungus
03/03/2022, 1:40 AMshaktiman_droid
03/03/2022, 3:08 PMjsBrowserDistribution
just to measure the accurate size?Big Chungus
03/03/2022, 3:13 PMpackJsNpmPublication
depends on jsProductionExecutable
and adds some metadata to it (like package.json, bundledDependencies, shrinkwrap.json). 99% of the time I personally would look at jsProductionExecutable
output when comparing sizes.shaktiman_droid
03/03/2022, 3:35 PMunminified
size right? For minified I guess we would still look at jsBrowserDistribution
output size?Big Chungus
03/03/2022, 3:37 PMBig Chungus
03/03/2022, 3:37 PMjsBrowserDistribution
just collects your resources and js outputshaktiman_droid
03/03/2022, 3:40 PMjsBrowserDistribution
and jsProductionExecutable
sizes match closely?
I get this output from jsProductionExecutable
size of the shared.js
in screenshot is 1.6MB
but the size of fat .js
file i get via jsBrowserDistribution
is 800KB
.Big Chungus
03/03/2022, 3:57 PMshaktiman_droid
03/03/2022, 4:00 PMBig Chungus
03/03/2022, 4:06 PMshaktiman_droid
03/03/2022, 4:44 PMjsProductionExecutable
and jsBrowserDistribution
outputsBig Chungus
03/04/2022, 8:54 AMshaktiman_droid
03/04/2022, 6:03 PM