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 publish unnessessary files #1241

Merged
merged 2 commits into from Sep 9, 2017
Merged

Don't publish unnessessary files #1241

merged 2 commits into from Sep 9, 2017

Conversation

simondel
Copy link
Contributor

@simondel simondel commented Sep 7, 2017

By ignoring everything at the start of the npmignore and then excluding the files you actually need, you can reduce your node_modules foodprint.

The difference:

What Current size New size Difference
node_modules 2.18 MB 1.57 MB 38.85%
js-beautify folder 1.27 MB 674 KB 46.93%
zipped 656 KB 416 KB 36.58%

If js-beautify would be downloaded 1.3 milion times in the month after this is released, it would save about 312 GB of traffic due to the smaller zip size.

@simondel
Copy link
Contributor Author

simondel commented Sep 7, 2017

The js folder still contains these files: If any files or folders are not required. Please let me know and I'll update the PR:
image
<Bestanden> are just files that are in the root of the folder.

@bitwiseman
Copy link
Member

@simondel - Are package.json and package-lock.json included?

@simondel
Copy link
Contributor Author

simondel commented Sep 8, 2017

@bitwiseman The package.json is always published. The package.lock.json is never published. The documenation about the npmignore specifies:

The following paths and files are never ignored, so adding them to .npmignore is pointless:

  • package.json
  • README (and its variants)
  • CHANGELOG (and its variants)
  • LICENSE / LICENCE

I tested this with your readme, changelog and license file see: https://github.com/simondel/tempsimonl892017. This package has been published to npm and does contain the files in the repo. I'll update the PR to no long explicitly include them.

The package.lock.json documentation states:

One key detail about package-lock.json is that it cannot be published, and it will be ignored if found in any place other than the toplevel package. It shares a format with npm-shrinkwrap.json, which is essentially the same file, but allows publication. This is not recommended unless deploying a CLI tool or otherwise using the publication process for producing production packages.

@bitwiseman
Copy link
Member

Great! Thanks!

@bitwiseman bitwiseman merged commit 468815e into beautifier:master Sep 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants