yarnpkg/yarn

Yarn pack is ignoring .npmignore files

Open

#685 opened on Oct 11, 2016

View on GitHub
 (37 comments) (37 reactions) (0 assignees)JavaScript (41,514 stars) (2,731 forks)batch import
good first issuehelp wantedtriaged

Description

Do you want to request a feature or report a bug?

Bug

What is the current behavior?

If I specify a .npmignore with a bunch of files that should NOT be published along with the package, a bunch of files seem to be included no matter what and some aren't included at all.

If the current behavior is a bug, please provide the steps to reproduce.

  1. Take existing project. My project has a lib directory. Create a file `.npmignore'
  2. Add a few directories that you want to exclude from the package. eg
src
node_modules
  1. Run yarn pack
  2. Run tar -ztvf <package>

Notice that the package contains README.md files that were specified in node_modules AND in src. It also does not include the directory lib.

What is the expected behavior?

node_modules and src should not exist in the archive. lib should exist in the archive.

Please mention your node.js, yarn and operating system version.

OS X: 10.11.6 node: 5.5.0 yarn: 0.15.1

Contributor guide