rollup-plugin-filesize
Advanced tools
Comparing version 9.0.2 to 9.1.0
@@ -74,3 +74,3 @@ 'use strict'; | ||
name | ||
} = await new Promise(function (resolve) { resolve(_interopNamespace(require(path.join(process.cwd(), "./package.json")))); }); | ||
} = await Promise.resolve().then(function () { return _interopNamespace(require(path.join(process.cwd(), "./package.json"))); }); | ||
@@ -104,6 +104,6 @@ try { | ||
info.bundleSize = fileSize(Buffer.byteLength(code), format); | ||
info.brotliSize = showBrotliSize ? fileSize((await brotli(code)), format) : ""; | ||
info.brotliSize = showBrotliSize ? fileSize(await brotli(code), format) : ""; | ||
if (showMinifiedSize || showGzippedSize) { | ||
const minifiedCode = terser.minify(code).code; | ||
const minifiedCode = (await terser.minify(code)).code; | ||
info.minSize = showMinifiedSize ? fileSize(minifiedCode.length, format) : ""; | ||
@@ -115,6 +115,6 @@ info.gzipSize = showGzippedSize ? fileSize(gzip.sync(minifiedCode), format) : ""; | ||
info.bundleSizeBefore = fileSize(Buffer.byteLength(codeBefore), format); | ||
info.brotliSizeBefore = showBrotliSize ? fileSize((await brotli(codeBefore)), format) : ""; | ||
info.brotliSizeBefore = showBrotliSize ? fileSize(await brotli(codeBefore), format) : ""; | ||
if (showMinifiedSize || showGzippedSize) { | ||
const minifiedCode = terser.minify(codeBefore).code; | ||
const minifiedCode = (await terser.minify(codeBefore)).code; | ||
info.minSizeBefore = showMinifiedSize ? fileSize(minifiedCode.length, format) : ""; | ||
@@ -146,5 +146,5 @@ info.gzipSizeBefore = showGzippedSize ? fileSize(gzip.sync(minifiedCode), format) : ""; | ||
if (reporter === "boxen") { | ||
p = new Promise(function (resolve) { resolve(_interopNamespace(require(path.join(thisDirectory, "/reporters/boxen.js")))); }); | ||
p = Promise.resolve().then(function () { return _interopNamespace(require(path.join(thisDirectory, "/reporters/boxen.js"))); }); | ||
} else { | ||
p = new Promise(function (resolve) { resolve(_interopNamespace(require(path.resolve(process.cwd(), reporter)))); }); | ||
p = Promise.resolve().then(function () { return _interopNamespace(require(path.resolve(process.cwd(), reporter))); }); | ||
} | ||
@@ -151,0 +151,0 @@ |
{ | ||
"name": "rollup-plugin-filesize", | ||
"version": "9.0.2", | ||
"version": "9.1.0", | ||
"description": "A rollup plugin to show filesize in the cli", | ||
@@ -48,3 +48,3 @@ "main": "dist/index.js", | ||
"pacote": "^11.1.10", | ||
"terser": "^4.8.0" | ||
"terser": "^5.5.1" | ||
}, | ||
@@ -51,0 +51,0 @@ "devDependencies": { |
@@ -95,3 +95,3 @@ import { readFile as origReadFile } from "fs"; | ||
if (showMinifiedSize || showGzippedSize) { | ||
const minifiedCode = terser.minify(code).code; | ||
const minifiedCode = (await terser.minify(code)).code; | ||
info.minSize = showMinifiedSize | ||
@@ -111,3 +111,3 @@ ? fileSize(minifiedCode.length, format) | ||
if (showMinifiedSize || showGzippedSize) { | ||
const minifiedCode = terser.minify(codeBefore).code; | ||
const minifiedCode = (await terser.minify(codeBefore)).code; | ||
info.minSizeBefore = showMinifiedSize | ||
@@ -114,0 +114,0 @@ ? fileSize(minifiedCode.length, format) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
36254
+ Added@jridgewell/gen-mapping@0.3.5(transitive)
+ Added@jridgewell/resolve-uri@3.1.2(transitive)
+ Added@jridgewell/set-array@1.2.1(transitive)
+ Added@jridgewell/source-map@0.3.6(transitive)
+ Added@jridgewell/sourcemap-codec@1.5.0(transitive)
+ Added@jridgewell/trace-mapping@0.3.25(transitive)
+ Addedacorn@8.12.1(transitive)
+ Addedterser@5.34.1(transitive)
- Removedterser@4.8.1(transitive)
Updatedterser@^5.5.1