Closed developit closed 5 years ago
That would be super neat! I'm all for that.
I mostly used the outputSizes
and getSizes
functions, removed reverseTemplate
I thought this was specific to Webpack, though the hash logic might have to be put back. I didn't try this yet with code splitting only with multiple bundles builds.
For this the default columnWidth
was added because multiple bundles wouldn't know about each other beforehand I think.
One bit in outputSizes
changed from assets[name].source()
to assets[name].code
.
Let me know if I can be of help for the core functionality.
Would they be exposed from size-plugin
or another isolated pkg?
Would love that history functionality 😃 We actually NEED that at work, take my size graph to meetings haha
Just an update from me, I still want this but haven't had time to hack on anything.
Might be nice to expose a method that lets folks populate sizesBefore
before calling outputSizes
. Also maybe make it a class?
@developit / @luwes I have updated the code.
Added option to override any step performed by size-plugin-core
.
e.g
const sizesBefore = await getPreviousSizes(outputPath) ;
const sizes = await getSizes(assets);
const files = await getDiff(sizesBefore,sizes); // calculate the diff
const output = await printSizes(files); // template output message
await uploadSizes(files); // upload stats
return output;
Hi @luwes!
I'm wondering if we should figure out a way to share the core size calculation and display logic between the two plugins so they can receive the same updates (in particular, GoogleChromeLabs/size-plugin#15). Thoughts?