Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "files" entry in package.json or .npmignore #28

Open
rubennorte opened this issue Mar 7, 2015 · 4 comments
Open

Add "files" entry in package.json or .npmignore #28

rubennorte opened this issue Mar 7, 2015 · 4 comments

Comments

@rubennorte
Copy link

Some files aren't needed when using the package as a dependency. It'd be great if you specify what are those files (.npmignore) or what are the files that are needed ("files" property in package.json). See https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package

@mikaelbr
Copy link
Owner

mikaelbr commented Mar 9, 2015

I've added the tests to the ignore-file now. I think the README should be in the directory for local reference (through node_modules)

@rubennorte
Copy link
Author

I think it's easier to specify the files you actually want to include in the "files" property. The README file is never ignored by npm:

The following paths and files are never ignored, so adding them to .npmignore is pointless:
package.json
README.*

@mikaelbr
Copy link
Owner

mikaelbr commented Mar 9, 2015

I'd agree with you in some cases, but in this case I think explicitly setting what files that should be included would be longer than the ignore list. And I'd also rather have some extra files than forget to add the a file to the include list and break a publish.

@rubennorte
Copy link
Author

In this case I suppose you only need:

package.json

{
  ...
  "files": [
    "bin",
    "lib",
    "index.js"
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants