rollup-plugin-visualizer
Advanced tools
Comparing version 0.9.2 to 1.0.0
{ | ||
"name": "rollup-plugin-visualizer", | ||
"version": "0.9.2", | ||
"version": "1.0.0", | ||
"main": "plugin.js", | ||
@@ -22,3 +22,3 @@ "author": "Denis Bardadym <bardadymchik@gmail.com>", | ||
"mkdirp": "^0.5.1", | ||
"opn": "^5.3.0", | ||
"opn": "^5.4.0", | ||
"source-map": "^0.7.3", | ||
@@ -28,20 +28,20 @@ "typeface-oswald": "0.0.54" | ||
"peerDependencies": { | ||
"rollup": ">=0.60.0 <1" | ||
"rollup": ">=0.60.0" | ||
}, | ||
"devDependencies": { | ||
"bytes": "^3.0.0", | ||
"d3-hierarchy": "^1.1.6", | ||
"d3-scale": "^2.1.0", | ||
"d3-selection": "^1.3.0", | ||
"d3-shape": "^1.0.3", | ||
"eslint": "^4.19.1", | ||
"prettier": "^1.14.2", | ||
"rollup": "^0.64.1", | ||
"rollup-plugin-commonjs": "^9.1.5", | ||
"rollup-plugin-node-resolve": "^3.3.0", | ||
"rollup-plugin-uglify": "^4.0.0" | ||
"bytes": "^3.1.0", | ||
"d3-hierarchy": "^1.1.8", | ||
"d3-scale": "^2.2.2", | ||
"d3-selection": "^1.4.0", | ||
"d3-shape": "^1.3.4", | ||
"eslint": "^5.14.1", | ||
"prettier": "^1.16.4", | ||
"rollup": "^1.2.2", | ||
"rollup-plugin-commonjs": "^9.2.0", | ||
"rollup-plugin-node-resolve": "^4.0.0", | ||
"rollup-plugin-uglify": "^6.0.2" | ||
}, | ||
"engines": { | ||
"node": ">=8.3.0" | ||
"node": ">=10" | ||
} | ||
} |
@@ -13,19 +13,13 @@ "use strict"; | ||
const readFont = (type = 'woff', weight = 700) => { | ||
const fonts = path.join(require.resolve('typeface-oswald'), '../files/'); | ||
const readFont = (type = "woff", weight = 700) => { | ||
const fonts = path.join(require.resolve("typeface-oswald"), "../files/"); | ||
return fs.readFileSync(path.join(fonts, `./oswald-latin-${weight}.${type}`)); | ||
}; | ||
const cssString = fs.readFileSync( | ||
path.join(__dirname, "lib", "./style.css"), | ||
"utf8" | ||
); | ||
const jsString = fs.readFileSync( | ||
path.join(__dirname, "lib", "./pluginmain.js"), | ||
"utf8" | ||
); | ||
const cssString = fs.readFileSync(path.join(__dirname, "lib", "./style.css"), "utf8"); | ||
const jsString = fs.readFileSync(path.join(__dirname, "lib", "./pluginmain.js"), "utf8"); | ||
const fontWeight = 500; | ||
const fontface = buildFontface('Oswald', fontWeight, { | ||
woff: readFont('woff', fontWeight).toString('base64'), | ||
woff2: readFont('woff2', fontWeight).toString('base64') | ||
const fontface = buildFontface("Oswald", fontWeight, { | ||
woff: readFont("woff", fontWeight).toString("base64"), | ||
woff2: readFont("woff2", fontWeight).toString("base64") | ||
}); | ||
@@ -41,31 +35,23 @@ | ||
const open = !!opts.open; | ||
const openOptions = opts.openOptions || {} | ||
const openOptions = opts.openOptions || {}; | ||
return { | ||
generateBundle(outputOptions, outputBundle) { | ||
const promises = Object.keys(outputBundle).map(id => { | ||
const bundle = outputBundle[id]; | ||
return Promise.resolve() | ||
.then(() => { | ||
if (useSourceMap) { | ||
return addMinifiedSizesToModules(bundle); | ||
} | ||
}) | ||
.then(() => { | ||
const root = buildTree(bundle, useSourceMap); | ||
flattenTree(root); | ||
async generateBundle(outputOptions, outputBundle) { | ||
const roots = []; | ||
return { id, root }; | ||
}); | ||
}); | ||
return Promise.all(promises) | ||
.then(roots => { | ||
const html = buildHtml(title, roots, filename); | ||
return writeFile(filename, html); | ||
}) | ||
.then(() => { | ||
if (open) { | ||
return opn(filename, openOptions); | ||
} | ||
}); | ||
for (const [id, bundle] of Object.entries(outputBundle)) { | ||
if (bundle.isAsset) continue; //only chunks | ||
if (useSourceMap) { | ||
await addMinifiedSizesToModules(bundle); | ||
} | ||
const root = buildTree(bundle, useSourceMap); | ||
flattenTree(root); | ||
roots.push({ id, root }); | ||
} | ||
const html = buildHtml(title, roots, filename); | ||
await writeFile(filename, html); | ||
if (open) { | ||
return opn(filename, openOptions); | ||
} | ||
} | ||
@@ -130,6 +116,5 @@ }; | ||
function writeFile(filename, contents) { | ||
return mkdirpAsync(path.dirname(filename)).then(() => | ||
writeFileAsync(filename, contents) | ||
); | ||
async function writeFile(filename, contents) { | ||
await mkdirpAsync(path.dirname(filename)); | ||
return await writeFileAsync(filename, contents); | ||
} | ||
@@ -136,0 +121,0 @@ |
Sorry, the diff of this file is too big to display
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
3983
1
138007
+ Added@rollup/rollup-android-arm-eabi@4.24.0(transitive)
+ Added@rollup/rollup-android-arm64@4.24.0(transitive)
+ Added@rollup/rollup-darwin-arm64@4.24.0(transitive)
+ Added@rollup/rollup-darwin-x64@4.24.0(transitive)
+ Added@rollup/rollup-linux-arm-gnueabihf@4.24.0(transitive)
+ Added@rollup/rollup-linux-arm-musleabihf@4.24.0(transitive)
+ Added@rollup/rollup-linux-arm64-gnu@4.24.0(transitive)
+ Added@rollup/rollup-linux-arm64-musl@4.24.0(transitive)
+ Added@rollup/rollup-linux-powerpc64le-gnu@4.24.0(transitive)
+ Added@rollup/rollup-linux-riscv64-gnu@4.24.0(transitive)
+ Added@rollup/rollup-linux-s390x-gnu@4.24.0(transitive)
+ Added@rollup/rollup-linux-x64-gnu@4.24.0(transitive)
+ Added@rollup/rollup-linux-x64-musl@4.24.0(transitive)
+ Added@rollup/rollup-win32-arm64-msvc@4.24.0(transitive)
+ Added@rollup/rollup-win32-ia32-msvc@4.24.0(transitive)
+ Added@rollup/rollup-win32-x64-msvc@4.24.0(transitive)
+ Added@types/estree@1.0.6(transitive)
+ Addedfsevents@2.3.3(transitive)
+ Addedrollup@4.24.0(transitive)
- Removed@types/estree@0.0.39(transitive)
- Removed@types/node@22.7.4(transitive)
- Removedrollup@0.68.2(transitive)
- Removedundici-types@6.19.8(transitive)
Updatedopn@^5.4.0