/index.js | 821 B
/A/index.js | 833 B
/B/index.js | 444 B
Users are expected to import the modules like this:
import A from 'package/A'
Some of the modules share the same internal dependencies, or have dependencies on each other. That's fine because I'm more interested in what the maximum potential cost of each module is, rather than showing that using A + B is less than the sum of their bundle sizes.
However, I know the values in the report are wrong in terms of the actual size contributes to bundles from importing say A/index.js. At first I assumed the action was only looking at the files themselves and not including their internal imports in the size calculation. But if I change the pattern to dist/**, not only do the reported sizes of the index.js files change but the plugin also reports size values for the directory itself (i.e., A). And some of the internal helper files also seem to have incorrect values. One standalone helper file was reported as being 4.5KB, but it's a small file and compressing it myself showed it to be 476 bytes.
I'm having trouble producing reports that look accurate.
I have a build that outputs a
dist
directory containing compiled (not minified) files structured like this:I have a workflow setup like this:
And it produces reports like this:
Users are expected to import the modules like this:
Some of the modules share the same internal dependencies, or have dependencies on each other. That's fine because I'm more interested in what the maximum potential cost of each module is, rather than showing that using A + B is less than the sum of their bundle sizes.
However, I know the values in the report are wrong in terms of the actual size contributes to bundles from importing say
A/index.js
. At first I assumed the action was only looking at the files themselves and not including their internal imports in the size calculation. But if I change the pattern todist/**
, not only do the reported sizes of theindex.js
files change but the plugin also reports size values for the directory itself (i.e.,A
). And some of the internal helper files also seem to have incorrect values. One standalone helper file was reported as being 4.5KB, but it's a small file and compressing it myself showed it to be476
bytes.