-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Labels
Description
From the version 5.0.0 the gzip size is always computed on a minified bundle. But it might happen that you want to display the size for a non minified bundle (e.g Rollup is used to generate two bundles one minified and one non minified).
filesize({
showMinifiedSize: false,
showGzippedSize: true,
}),
// expected output → file size gzipped on non minified source codefilesize({
showMinifiedSize: true,
showGzippedSize: true,
}),
// expected output → file size gzipped on minified source coderollup-plugin-filesize/src/index.js
Lines 50 to 58 in 22e8c89
| if (opts.showMinifiedSize || opts.showGzippedSize) { | |
| const minifiedCode = terser.minify(code).code; | |
| sizes.minSize = opts.showMinifiedSize | |
| ? fileSize(minifiedCode.length, opts.format) | |
| : ""; | |
| sizes.gzipSize = opts.showGzippedSize | |
| ? fileSize(gzip.sync(minifiedCode), opts.format) | |
| : ""; | |
| } |
bugs181 and Haroenv