Socket
Socket
Sign inDemoInstall

rollup-plugin-filesize

Package Overview
Dependencies
Maintainers
1
Versions
45
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-filesize - npm Package Compare versions

Comparing version 0.5.4 to 0.5.5

25

dist/index.js

@@ -13,9 +13,9 @@ 'use strict';

function render(opt, size, gzip) {
return opt.theme == 'dark' ? boxen(chalk.green.bold('Bundle size: ') + chalk.yellow.bold(size) + ', ' + chalk.green.bold('Gzipped size: ') + chalk.yellow.bold(gzip), { padding: 1 }) : boxen(chalk.black.bold('Bundle size: ') + chalk.blue.bold(size) + ', ' + chalk.black.bold('Gzipped size: ') + chalk.blue.bold(gzip), { padding: 1 });
}
function filesize() {
var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];
function render(opt, size, gzip) {
return opt.theme == 'dark' ? boxen(chalk.green.bold('Bundle size: ') + chalk.yellow.bold(size) + ', ' + chalk.green.bold('Gzipped size: ') + chalk.yellow.bold(gzip), { padding: 1 }) : boxen(chalk.black.bold('Bundle size: ') + chalk.blue.bold(size) + ', ' + chalk.black.bold('Gzipped size: ') + chalk.blue.bold(gzip), { padding: 1 });
}
var defaultOptions = {

@@ -33,16 +33,11 @@ format: {},

return {
getData: function getData(code) {
var size = fileSize(Buffer.byteLength(code), opts.format);
var gzipSize = fileSize(gzip.sync(code), opts.format);
return opts.render(opts, size, gzipSize);
},
ongenerate: function ongenerate(bundle, _ref) {
var code = _ref.code;
var size = fileSize(Buffer.byteLength(code), opts.format);
var gzipSize = fileSize(gzip.sync(code), opts.format);
console.log(opts.render(opts, size, gzipSize));
return {
log: opts.render(opts, size, gzipSize),
code: code,
map: {
mappings: ''
}
};
console.log(this.getData(code));
}

@@ -49,0 +44,0 @@ };

2

package.json
{
"name": "rollup-plugin-filesize",
"version": "0.5.4",
"version": "0.5.5",
"description": "A rollup plugin to show filesize in the cli",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -9,14 +9,14 @@ import fileSize from 'filesize';

function render (opt, size, gzip) {
return opt.theme == 'dark' ? (
boxen(chalk.green.bold('Bundle size: ') + chalk.yellow.bold(size) + ', ' +
chalk.green.bold('Gzipped size: ') + chalk.yellow.bold(gzip), { padding: 1 })
) : (
boxen(chalk.black.bold('Bundle size: ') + chalk.blue.bold(size) + ', ' +
chalk.black.bold('Gzipped size: ') + chalk.blue.bold(gzip), { padding: 1 })
);
}
export default function filesize (options = {}) {
function render (opt, size, gzip) {
return opt.theme == 'dark' ? (
boxen(chalk.green.bold('Bundle size: ') + chalk.yellow.bold(size) + ', ' +
chalk.green.bold('Gzipped size: ') + chalk.yellow.bold(gzip), { padding: 1 })
) : (
boxen(chalk.black.bold('Bundle size: ') + chalk.blue.bold(size) + ', ' +
chalk.black.bold('Gzipped size: ') + chalk.blue.bold(gzip), { padding: 1 })
);
}
let defaultOptions = {

@@ -34,16 +34,12 @@ format: {},

return {
ongenerate(bundle, { code }){
getData (code) {
let size = fileSize(Buffer.byteLength(code), opts.format);
let gzipSize = fileSize(gzip.sync(code), opts.format);
return opts.render(opts, size, gzipSize);
},
console.log(opts.render(opts, size, gzipSize));
return {
log: opts.render(opts, size, gzipSize),
code: code,
map: {
mappings: ''
}
}
ongenerate(bundle, { code }){
console.log(this.getData(code));
}
}
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc