rollup-plugin-visualizer
Advanced tools
Comparing version 3.3.0 to 3.3.1
{ | ||
"name": "rollup-plugin-visualizer", | ||
"version": "3.3.0", | ||
"version": "3.3.1", | ||
"main": "plugin/index.js", | ||
@@ -5,0 +5,0 @@ "author": "Denis Bardadym <bardadymchik@gmail.com>", |
@@ -19,6 +19,2 @@ "use strict"; | ||
if (mod.renderedLength === 0) { | ||
continue; | ||
} | ||
const nodeData = { uid }; | ||
@@ -117,3 +113,3 @@ | ||
const mod = mapper.getValue(moduleUid, { size: 0 }); | ||
const mod = mapper.getValue(moduleUid, { renderedLength: 0 }); | ||
@@ -120,0 +116,0 @@ const info = getModuleInfo(moduleId); |
@@ -26,2 +26,3 @@ "use strict"; | ||
const warn = require("./warn"); | ||
const { createGzipSizeGetter } = require("./compress"); | ||
@@ -56,5 +57,20 @@ const WARN_SOURCEMAP_DISABLED = | ||
const gzipSize = !!opts.gzipSize; | ||
const additionalFilesInfo = new Map(); | ||
const gzipSizeGetter = gzipSize | ||
? createGzipSizeGetter(typeof opts.gzipSize === "object" ? gzipSize : {}) | ||
: null; | ||
return { | ||
name: "visualizer", | ||
async transform(code, id) { | ||
const info = {}; | ||
if (gzipSize) { | ||
info.gzipLength = await gzipSizeGetter(code); | ||
} | ||
additionalFilesInfo.set(id, info); | ||
return null; | ||
}, | ||
async generateBundle(outputOptions, outputBundle) { | ||
@@ -106,5 +122,14 @@ if (opts.sourcemap && !outputOptions.sourcemap) { | ||
const tree = mergeTrees(roots); | ||
const { nodes, nodeIds } = mapper; | ||
for (const [id, uid] of Object.entries(nodeIds)) { | ||
if (nodes[uid]) { | ||
nodes[uid] = { | ||
...nodes[uid], | ||
...(additionalFilesInfo.get(id) || {}) | ||
}; | ||
} else { | ||
this.warn(`Could not find mapping for node ${id} ${uid}`); | ||
} | ||
} | ||
const { nodes, nodeIds } = mapper; | ||
removeCommonPrefix(nodes, nodeIds); | ||
@@ -120,2 +145,4 @@ | ||
const tree = mergeTrees(roots); | ||
const data = { version: JSON_VERSION, tree, nodes, links }; | ||
@@ -122,0 +149,0 @@ |
@@ -84,8 +84,6 @@ # Rollup Plugin Visualizer | ||
v1 -> v2: For v2 was a lot of internal changes, but external interface has not changed. | ||
See CHANGELOG.md. | ||
V2 -> V3: `template` now by default `treemap`, `bundlesRelative` was removed as it is always default behaviour. | ||
## Acknowledgements | ||
Initially this plugin was based on `webpack-visualizer`, but in the end used only styles and layout. Thanks to the tons of people around internet for great examples of d3 usage. Also i would like to thank you Mike Bostock for awesome D3, and tons of examples. |
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
1154355
27
12186
89