Closed hueniverse closed 8 years ago
Agreed... we should ignore everything except lib
and package.json
.
Already doing it on joi, that was ~10x improvement in size. Someone said on gitter that keeping API.md would be helpful when you're offline, that's not much of a sacrifice to keep.
I like what you did with joi to keep .gitignore in sync with .npmignore using the npmignore tool.
I don't think we should keep any docs with the npm package. If people want the docs they should grab the docs. The hapi doc is 154K.
Great idea. I've implemented this on yar and accept.
The .npmignore
file can be made to be very simple:
https://github.com/hapijs/reptile/blob/master/.npmignore
*
!lib/
I like @geek's suggestion. That's nice and clean.
i like @geek's solution too, nice and portable
@geek is my hero
@geek is a hero to us all
That doesn't work for me on joi, only index is included. But that does:
*
!lib/**
I can confirm @Marsup. I tried this on another module and the only file under "lib" that was included was "index.js".
You can test this locally with tar -tf $(npm pack) && rm *.tgz
that'll list the files when npm tars up your module.
Should the license travel with the code for good measure?
There are some files that are never ignored, including the license. See https://docs.npmjs.com/misc/developers#keeping-files-out-of-your-package.
Despite what the documentation says what I run npm pack
with marsup's .npmignore
the README.md file is never included but LICENSE is. Do any of you have the same issue? And will it properly show up in npmjs.org?
The readme is there for me, which version of npm ?
I thought the readme gets tossed into the package.json, no?
On Mon, Jun 13, 2016, 9:21 AM Nicolas Morel notifications@github.com wrote:
The readme is there for me, which version of npm ?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hapijs/contrib/issues/90#issuecomment-225632140, or mute the thread https://github.com/notifications/unsubscribe/ABSVf40TDXmUWOazFddDM0OJ1knycezjks5qLYNvgaJpZM4IvWal .
node v6.2.1 npm 3.9.3 Trying to update to 3.9.5
Definitely not included in the package.json in npm pack
at least.
Works with 3.8.6. Definitely a bug with npm.
You are right: https://github.com/npm/npm/issues/12876 which then links all the way back to a 2014 issue :)
So, be careful, if you're publishing with node 6 and npm 3.9.3 (or 3.9.5) for that matter.
As soon as you exclude .npmignore
or you use the wildcard match, it will exclude the README :(
This worked for me in node 6... unfortunately includes the .npmignore file but oh well.
*
!lib/**
!.npmignore
I think it time to change our .npmignore policy and reduce package sizes. Thoughts?