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

Can we reduce npm package size? #649

Closed
rxaviers opened this issue Nov 9, 2016 · 9 comments
Closed

Can we reduce npm package size? #649

rxaviers opened this issue Nov 9, 2016 · 9 comments
Labels

Comments

@rxaviers
Copy link
Member

rxaviers commented Nov 9, 2016

  • Examples are responsible for 3.7M.
  • Temporary dist/.build for another ~1M.
@rxaviers
Copy link
Member Author

rxaviers commented Nov 9, 2016

Examples are responsible for 3.7M. They are usually helpful for development, but are generally useless in an npm installation. We could remove them from the npm package.

Temporary dist/.build is responsible for another ~1M. We should definitely remove it from npm package and any other distribution.

@jzaefferer
Copy link
Contributor

In a way, examples are part of the documentation, which is useful to include. I don't follow how they end up at 3.7 MB though. Maybe that's nested node_modules that you had locally when you published, and npm just published them along with everything else? If that's the issue, we should definitely exclude those nested node_modules.

@rxaviers
Copy link
Member Author

rxaviers commented Nov 10, 2016

Jörn, you're correct, just found the culprit examples/app-bower-grunt-requirejs/bower_components. The release script could assert those aren't present.

  • Release script to rm any examples node_modules or bower_components.
  • Build script to rm temporary dist/.build.

@jzaefferer
Copy link
Contributor

Probably simpler would be adding those to .gitignore (or .npmignore, if necessary).

@rxaviers
Copy link
Member Author

Good point.

@rxaviers
Copy link
Member Author

These files were already in .gitignore and are correctly being ignored by git, but not by npm. It seems to be a npm bug npm/npm#7264.

@jzaefferer
Copy link
Contributor

Can it be worked around using explicit .npmignore?

@rxaviers
Copy link
Member Author

I believe not since the npm-linked issue is about .npmignore too. Anyway, I think it's awful to have to duplicate .gitignore.

@jzaefferer
Copy link
Contributor

Could try to remove the nested .gitignore files and pull everything up into the main one.

rxaviers added a commit to rxaviers/globalize that referenced this issue Dec 14, 2016
Used negate expressions in package.json files entry, although it goes
against recommendation below, because that's the only thing that
worked.

> "The consequences are undefined" if you try to negate any of the files
> entries (that is, "!foo.js"). Please don't. Use .npmignore.

https://github.com/npm/npm/wiki/Files-and-Ignores#details

Fixes globalizejs#649
Closes globalizejs#658
rxaviers added a commit to rxaviers/globalize that referenced this issue Dec 14, 2016
rxaviers added a commit to rxaviers/globalize that referenced this issue Dec 14, 2016
rxaviers added a commit to rxaviers/globalize that referenced this issue Dec 14, 2016
Used negate expressions in package.json files entry, although it goes
against recommendation below, because that's the only thing that
worked. Read the github references below for details.

> "The consequences are undefined" if you try to negate any of the files
> entries (that is, "!foo.js"). Please don't. Use .npmignore.

https://github.com/npm/npm/wiki/Files-and-Ignores#details

Fixes globalizejs#649
Closes globalizejs#658
rxaviers added a commit that referenced this issue Dec 14, 2016
rxaviers added a commit that referenced this issue Dec 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants