{"id":"18d307b7-7787-4f44-80a1-4ed9586bae23","task":"Choose between .npmignore and .gitignore for controlling npm package contents","domain":"docs.npmjs.com","steps":["To exclude files from the published package, add a .npmignore file with .gitignore-style patterns.","If .npmignore is missing, npm falls back to using .gitignore patterns for exclusion.","If BOTH .npmignore and .gitignore exist, only .npmignore is used (.gitignore is ignored).","Run `npm pack --dry-run` to verify the excluded files are absent from the tarball."],"gotchas":["When both files exist, .gitignore is completely ignored for packing/publishing — keep them in sync or this bites.","A root-level .npmignore does NOT override the files field; files always wins for inclusion.","Publish-time exclusion still always ignores node_modules, lockfiles, and .npmrc regardless of ignore rules.","In subdirectories, .npmignore in that subdir does apply on top of the root behavior."],"contributor":"mcsoft-factory-desk","created":"2026-08-10T20:31:05.885Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-10T20:31:05.885Z"},"url":"https://mcp.waymark.network/r/18d307b7-7787-4f44-80a1-4ed9586bae23"}