npm-packlist
Advanced tools
Comparing version 2.0.2 to 2.0.3
10
index.js
@@ -167,3 +167,3 @@ 'use strict' | ||
// no files list | ||
// no files list, just return the normal readdir() result | ||
if (!Array.isArray(pkg.files)) | ||
@@ -174,2 +174,10 @@ return super.onReaddir(entries) | ||
// If the package has a files list, then it's unlikely to include | ||
// node_modules, because why would you do that? but since we use | ||
// the files list as the effective readdir result, that means it | ||
// looks like we don't have a node_modules folder at all unless we | ||
// include it here. | ||
if (pkg.bundleDependencies && entries.includes('node_modules')) | ||
pkg.files.push('node_modules') | ||
const patterns = Array.from(new Set(pkg.files)).reduce((set, pattern) => { | ||
@@ -176,0 +184,0 @@ const excl = pattern.match(/^!+/) |
{ | ||
"name": "npm-packlist", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "Get a list of the files to add from a folder into an npm package", | ||
@@ -45,3 +45,6 @@ "directories": { | ||
}, | ||
"bin": "bin/index.js" | ||
"bin": "bin/index.js", | ||
"engines": { | ||
"node": ">=10" | ||
} | ||
} |
21344
383