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

Don't include unnecesary files in the npm package #535

Merged
merged 2 commits into from
Jan 29, 2017

Conversation

gpittarelli
Copy link
Contributor

@gpittarelli gpittarelli commented Jan 26, 2017

Fixes #516

Looks to me like only bin/lib are needed (well, and package.json, CHANGELOG.md, LICENSE, README.md which are included by default)--so I switched out the .npmignore for a 2 entry files.
Edit: ^ undid the switch

I wasn't 100% sure about the yarn files; looks like the answer is don't publish them: see the last line of https://yarnpkg.com/en/docs/yarn-lock

I sanity checked with:

npm pack
tar xvf lerna-2.0.0-beta.33.tgz
cd package
ls -a  # => bin  CHANGELOG.md  lib  LICENSE  package.json  README.md
./bin/lerna.js # => prints help message

Cuts the package size in half :)

$ du -b --apparent-size lerna-2.0.0-beta.33.tgz after.tgz             
72884   lerna-2.0.0-beta.33.tgz
33347   after.tgz

Copy link
Contributor

@hzoo hzoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely safer to use .npmignore (might add a file used but it's not added to files) but i'm ok with this

@doug-wade
Copy link
Contributor

Hi @gpittarelli! I really dig saving 40K of disk space, but I'd really prefer that we use .npmignore rather than files/ With files if we add a new file and forget to update files, lerna will be broken for clients; if we use .npmignore, instead the risk is we might include files clients don't need.

Copy link
Contributor

@doug-wade doug-wade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much @gpittarelli!

@doug-wade doug-wade merged commit b041aad into lerna:master Jan 29, 2017
@lock
Copy link

lock bot commented Dec 27, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 27, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants