rollup-plugin-visualizer
Advanced tools
Comparing version 2.5.4 to 2.6.0
{ | ||
"name": "rollup-plugin-visualizer", | ||
"version": "2.5.4", | ||
"version": "2.6.0", | ||
"main": "plugin/index.js", | ||
@@ -5,0 +5,0 @@ "author": "Denis Bardadym <bardadymchik@gmail.com>", |
@@ -8,7 +8,8 @@ "use strict"; | ||
module.exports = async function buildHtml(title, nodesData, graphType) { | ||
const [template, script, style] = await Promise.all([ | ||
module.exports = async function buildHtml(title, nodesData, graphType, styleOverridePath) { | ||
const [template, script, style, styleOverride] = await Promise.all([ | ||
readFile(path.join(__dirname, "stats.template"), "utf-8"), | ||
readFile(path.join(__dirname, "..", "lib", `main-${graphType}.js`), "utf8"), | ||
readFile(path.join(__dirname, "..", "lib", `style-${graphType}.css`), "utf8") | ||
readFile(path.join(__dirname, "..", "lib", `style-${graphType}.css`), "utf8"), | ||
styleOverridePath ? readFile(styleOverridePath, "utf8") : Promise.resolve() | ||
]); | ||
@@ -20,4 +21,5 @@ | ||
script, | ||
styleOverride, | ||
nodesData: JSON.stringify(nodesData) | ||
}); | ||
}; |
@@ -43,2 +43,3 @@ "use strict"; | ||
const template = opts.template || "sunburst"; | ||
const styleOverridePath = opts.styleOverridePath; | ||
@@ -116,3 +117,3 @@ const bundlesRelative = !!opts.bundlesRelative; | ||
const html = await buildStats(title, roots, template); | ||
const html = await buildStats(title, roots, template, styleOverridePath); | ||
@@ -119,0 +120,0 @@ await mkdir(path.dirname(filename)); |
@@ -47,2 +47,4 @@ # Rollup Plugin Visualizer | ||
`styleOverridePath` (string, default `undefined`) - Link your own css file to override or enhance the current templates | ||
`bundlesRelative` (boolean, default `false`) - Combine all bundles to one diagram | ||
@@ -66,4 +68,8 @@ | ||
## Upgrades | ||
v1 -> v2: For v2 was a lot of internal changes, but external interface has not changed. | ||
## 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. |
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
1239981
12008
74