Skip to content

include only the lib/ folder in the package, exclude tests and examples #176

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

Closed
wants to merge 1 commit into from

Conversation

necccc
Copy link

@necccc necccc commented Nov 16, 2018

This npm module has 56kByte overhead with tests and examples, not needed for the functionality of the module itself. Fixed this by adding the 'files' field in the package.json.

This npm module has 56kByte overhead with tests and examples, not needed for the functionality of the module itself. Fixed this by adding the 'files' field in the package.json.
Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

No. The files key is dangerous; if a new file is added to the package but omitted from this list, downstream consumers would break.

Separately, the tests are supposed to be published to npm. npm explore foo && npm install && npm test should always work.

@ljharb
Copy link
Member

ljharb commented Nov 16, 2018

Duplicate of #175. Duplicate of #132. Duplicate of #128. Duplicate of #99. Duplicate of #59. Duplicate of #44.

@ljharb ljharb closed this Nov 16, 2018
@necccc
Copy link
Author

necccc commented Nov 16, 2018

Beg to differ, whenever one is contributing to a package, usually uses the git repo - its logical if you need pull requests.

This approach results in approx 16kBytes of content on average for every package in npm not related to the functionality of the package. (based on my recent research) - it would be interesting to see actually how many ppl use the explore command.

@necccc
Copy link
Author

necccc commented Nov 16, 2018

But you're the maintainer so it's your decision.

@ljharb
Copy link
Member

ljharb commented Nov 16, 2018

You can’t use the git repo if you installed, and are later working offline.

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

Successfully merging this pull request may close these issues.

2 participants