Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

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 8.0.1 to 8.0.2

28

dist/index.js

@@ -34,4 +34,14 @@ 'use strict';

const readFile = util.promisify(fs.readFile);
const thisDirectory = path.dirname(new URL((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.js', document.baseURI).href))).pathname);
const isWindows = process.platform === "win32";
function fixWindowsPath(path) {
return path.slice( // istanbul ignore next
isWindows ? 1 : 0);
} // Node should be ok with this, but transpiling
// to `require` doesn't work, so detect Windows
// to remove slash instead
// "file://" +
const thisDirectory = fixWindowsPath(path.dirname(new URL((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.js', document.baseURI).href))).pathname));
function filesize(options = {}, env) {

@@ -62,3 +72,3 @@ let {

name
} = await new Promise(function (resolve) { resolve(_interopNamespace(require(path.join(process.cwd(), "./package.json")))); });
} = await new Promise(function (resolve) { resolve(_interopNamespace(require(fixWindowsPath(path.join(process.cwd(), "./package.json"))))); });

@@ -130,15 +140,5 @@ try {

if (reporter === "boxen") {
p = new Promise(function (resolve) { resolve(_interopNamespace(require( // Node should be ok with this, but transpiling
// to `require` doesn't work, so detect Windows
// to remove slash instead
// "file://" +
path.dirname(new URL((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.js', document.baseURI).href))).pathname).slice( // istanbul ignore next
isWindows ? 1 : 0) + "/reporters/boxen.js"))); });
p = new Promise(function (resolve) { resolve(_interopNamespace(require(thisDirectory + "/reporters/boxen.js"))); });
} else {
p = new Promise(function (resolve) { resolve(_interopNamespace(require( // Node should be ok with this, but transpiling
// to `require` doesn't work, so detect Windows
// to remove slash instead
// "file://" +
path.resolve(process.cwd(), reporter).slice( // istanbul ignore next
isWindows ? 1 : 0)))); });
p = new Promise(function (resolve) { resolve(_interopNamespace(require(fixWindowsPath(path.resolve(process.cwd(), reporter))))); });
}

@@ -145,0 +145,0 @@

{
"name": "rollup-plugin-filesize",
"version": "8.0.1",
"version": "8.0.2",
"description": "A rollup plugin to show filesize in the cli",

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

"dist",
"README"
"README",
"!.DS_Store",
"!.nyc_output"
],

@@ -13,0 +15,0 @@ "scripts": {

@@ -13,6 +13,19 @@ import { readFile as origReadFile } from "fs";

const thisDirectory = dirname(new URL(import.meta.url).pathname);
const isWindows = process.platform === "win32";
function fixWindowsPath(path) {
return path.slice(
// istanbul ignore next
isWindows ? 1 : 0
);
}
// Node should be ok with this, but transpiling
// to `require` doesn't work, so detect Windows
// to remove slash instead
// "file://" +
const thisDirectory = fixWindowsPath(
dirname(new URL(import.meta.url).pathname)
);
export default function filesize(options = {}, env) {

@@ -37,3 +50,5 @@ let {

if (showBeforeSizes !== "build") {
const { name } = await import(join(process.cwd(), "./package.json"));
const { name } = await import(
fixWindowsPath(join(process.cwd(), "./package.json"))
);
try {

@@ -129,23 +144,5 @@ const output = join(thisDirectory, "../.cache");

if (reporter === "boxen") {
p = import(
// Node should be ok with this, but transpiling
// to `require` doesn't work, so detect Windows
// to remove slash instead
// "file://" +
dirname(new URL(import.meta.url).pathname).slice(
// istanbul ignore next
isWindows ? 1 : 0
) + "/reporters/boxen.js"
);
p = import(thisDirectory + "/reporters/boxen.js");
} else {
p = import(
// Node should be ok with this, but transpiling
// to `require` doesn't work, so detect Windows
// to remove slash instead
// "file://" +
pathResolve(process.cwd(), reporter).slice(
// istanbul ignore next
isWindows ? 1 : 0
)
);
p = import(fixWindowsPath(pathResolve(process.cwd(), reporter)));
}

@@ -152,0 +149,0 @@ reporter = (await p).default;

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc