-
Notifications
You must be signed in to change notification settings - Fork 215
Proposal to .npmignore anything that's not needed for production #199
Comments
Those numbers are amazing 😄. Trimming down is tricky, as each of Intl.complete.js, json and jsonp offer an alternative option based on the polyfill consumer's preference. Intl.complete.js is commonly only used in Node or packaged apps that run locally, whereas json and jsonp are lightweight alternatives for browser environments. We could possibly ditch either jsonp (~20M, whitespace/key quotes stripped) or json (~56M, human readable), depending on which is more popular to serve. @caridy, what do you think? |
I will work on this on Thursday. |
ok, finally I get a chance to look at this problem holistically, here are my thoughts:
I will submit a PR soon. |
@bensontrent I did some partial clean up, but unfortunately we can't really remove dist/ because people are using it directly. I plan to do so in 1.3.x, in the meantime, I will keep this open. |
@caridy An 80% reduction in the npm package size? That's more than a modest partial cleanup, I'd say that's a win already. Here's what intl looks like after your revisions: And here's a report by file type report: Nice work! |
Glad to see the file size going down! But the |
ok, with 1.2.6 we are going down to ~500K package (~5mb expanded), which I think is sufficient for now. @bensontrent thanks a lot for pushing us to get to that point. |
Holy cow @caridy I'm impressed - a 93% savings. And look how popular Intl has become since we first started this conversation in July--the stats have doubled on what was already a very popular package. My (certainly-inaccurate) napkin calculation estimates the 93% reduction in size saves 60 Terabytes of storage and transmission, every day. Way to go! 😃 |
When using
npm install
with intl.js, I've found it requires 71 mb of disk space. Can this be trimmed down for production? I haven't researched the code yet, but it appears thejson
andjsonp
folders are covered by complete.js? Or ifjson
andjsonp
are needed, is it possible to refactor duplicitous code? Could we lose thesrc
andlib
folders for npm installs? Could we direct npm to just thedist
folder? I'd be happy to make a proposal through a pull request.My sob story: I ran into a situation where I was using a corporate laptop that had a 128GB SSD hard drive; I had maybe 10 gb left at the beginning of the week, and then by Thursday the laptop crashed to the point a windows restore couldn't work as there wasn't space left. I had been installing many projects using
npm install
, and I discovered that typically 80% of the space in node modules was taken up by the Intl.js package.For inspiration, I'm looking at the connect package. They obviously were saving every byte.

They use the "files" method in package.json to achieve this result when installing via npm.

Their source remains untouched in github with test and other files not needed during production
And considering the Intl.js's incredible popularity, economically, every byte counts.

Those numbers are kind of amazing.
The text was updated successfully, but these errors were encountered: