mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
13 lines
259 B
JavaScript
13 lines
259 B
JavaScript
const gzip = require('gzip-size');
|
|
|
|
module.exports = function sizes({ getSize }) {
|
|
return {
|
|
ongenerate(bundle, { code }) {
|
|
const size = Buffer.byteLength(code);
|
|
const gzipSize = gzip.sync(code);
|
|
|
|
getSize(size, gzipSize);
|
|
},
|
|
};
|
|
};
|