metalsmith-browserify
Advanced tools
Comparing version 1.0.2 to 1.0.3
const { Readable } = require('stream'); | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const debug = require('debug')('metalsmith-browserify'); | ||
@@ -59,4 +60,23 @@ const browserify = require('browserify'); | ||
const source = metalsmith.source(); | ||
const promises = options.entries.map(file => bundle({ file, options, source, files })); | ||
// remove entries that are not present in files | ||
// this can happen during metalsmith-watch | ||
// as only changed files are present in the files object | ||
function isInFiles(file) { | ||
if (!files[file]) { | ||
debug(`File ${file} not found.`); | ||
return false; | ||
} | ||
return true; | ||
} | ||
function bundleFile(file) { | ||
return bundle({ file, options, source, files }); | ||
} | ||
const promises = options.entries | ||
.filter(isInFiles) | ||
.map(bundleFile); | ||
return Promise.all(promises) | ||
@@ -63,0 +83,0 @@ .then(() => done()) |
{ | ||
"name": "metalsmith-browserify", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Metalsmith plugin to bundle JS with browserify", | ||
@@ -5,0 +5,0 @@ "repository": { |
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
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
13456
177
0
1