Skip to content

add .npmignore #1875

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

Merged
merged 1 commit into from
Jul 24, 2020
Merged

add .npmignore #1875

merged 1 commit into from
Jul 24, 2020

Conversation

necccc
Copy link
Contributor

@necccc necccc commented Oct 26, 2018

Hi 👋

I’ve been doing a little research for a conference talk on how npm package size relates to their content, and your package was one in the several ones that were flagged by my scripts. It has an outstanding weekly download count on npm and relatively large content that is not related directly to the package functionality.

I've added some files and folders to an .npmignore file, so they won't get packaged next time you release it on npm.

Thanks, and have a great day!

@jsf-clabot
Copy link

jsf-clabot commented Oct 26, 2018

CLA assistant check
All committers have signed the CLA.

@dmethvin
Copy link
Member

I think we'll want to think through whether to exclude some of these. No argument at all about demos but some of the others might be useful to someone who isn't just taking the pre-built file.

@fnagel
Copy link
Member

fnagel commented Jan 22, 2020

The general idea makes sense to me, but I'm no npm package expert.

@arschmitz @mgol Any opinions regarding this change?

@fnagel fnagel self-assigned this Jan 22, 2020
@mgol
Copy link
Member

mgol commented Jan 22, 2020

@fnagel This is a similar setup to what Core now uses. That said, I personally prefer declaring the files array in package.json; various tools may generate their own files inside of the repository main folder and it might be hard to always catch all of them.

@fnagel
Copy link
Member

fnagel commented May 15, 2020

Now that @arschmitz approved this: it would be great to include this in the next release!

@mgol are you fine with the content of the file? I personally would prefer an extra file for this, like git does.

@dmethvin You said "but some of the others might be useful to someone who isn't just taking the pre-built file". Which files do you have in mind here? .jshintrc, .csslintrc and .gitattributes?

@mgol
Copy link
Member

mgol commented May 15, 2020

@fnagel In my experience, using a list of files/directories to include as opposed of a list to exclude usually scales better. There is always a new IDE that will add its own directory that we wouldn't want to publish. On the other hand, we're using jquery-release here that always works with a fresh repo clone so it won't have this type of files/directories. So maybe there's no real risk here.

The list looks good to me. I haven't checked if we can exclude more but the current list looks good to exclude. Core also doesn't include Grunftfile or linter config files, or tests in its published bundle, compare the files/directories at https://github.com/jquery/jquery with https://unpkg.com/browse/[email protected]/.

@fnagel
Copy link
Member

fnagel commented Jul 23, 2020

@necccc One last thing before merging this: would you please change the commit message to "External: Add .npmignore file" or allow me to change your branch? Thanks!

@fnagel fnagel merged commit bcdaf14 into jquery:master Jul 24, 2020
@fnagel
Copy link
Member

fnagel commented Jul 24, 2020

@necccc I changed the commit message and merged the PR. Thanks for your contribution!

@fnagel fnagel added this to the 1.13 milestone Jul 27, 2020
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.

6 participants