diff --git a/node_modules/npm-packlist/lib/index.js b/node_modules/npm-packlist/lib/index.js index e4a2e76c545f6..bd72329f027e6 100644 --- a/node_modules/npm-packlist/lib/index.js +++ b/node_modules/npm-packlist/lib/index.js @@ -34,10 +34,13 @@ const glob = require('glob') const globify = pattern => pattern.split('\\').join('/') const readOutOfTreeIgnoreFiles = (root, rel, result = '') => { - for (const file of ['.gitignore', '.npmignore']) { + for (const file of ['.npmignore', '.gitignore']) { try { const ignoreContent = fs.readFileSync(path.join(root, file), { encoding: 'utf8' }) result += ignoreContent + '\n' + // break the loop immediately after concatting, this allows us to prioritize the + // .npmignore and discard the .gitignore if one exists + break } catch (err) { // we ignore ENOENT errors completely because we don't care if the file doesn't exist // but we throw everything else because failing to read a file that does exist is diff --git a/node_modules/npm-packlist/package.json b/node_modules/npm-packlist/package.json index dfa0188b4c437..4c63caf21e810 100644 --- a/node_modules/npm-packlist/package.json +++ b/node_modules/npm-packlist/package.json @@ -1,6 +1,6 @@ { "name": "npm-packlist", - "version": "5.1.0", + "version": "5.1.1", "description": "Get a list of the files to add from a folder into an npm package", "directories": { "test": "test" diff --git a/package-lock.json b/package-lock.json index 387d80a55326e..9df449f6986b8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5141,9 +5141,9 @@ } }, "node_modules/npm-packlist": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.1.0.tgz", - "integrity": "sha512-a04sqF6FbkyOAFA19AA0e94gS7Et5T2/IMj3VOT9nOF2RaRdVPQ1Q17Fb/HaDRFs+gbC7HOmhVZ29adpWgmDZg==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-5.1.1.tgz", + "integrity": "sha512-UfpSvQ5YKwctmodvPPkK6Fwk603aoVsf8AEbmVKAEECrfvL8SSe1A2YIwrJ6xmTHAITKPwwZsWo7WwEbNk0kxw==", "inBundle": true, "dependencies": { "glob": "^8.0.1",