npmignore

How to debug .npmignore?

一世执手 提交于 2019-12-23 19:14:41
问题 How can package files (these to be published) be listed to debug records in .npmignore ? I'm looking for something like equivalent of git ls-files for .gitignore . The only way I have found so far is to pack the package and then list the archive which I find a bit clumsy: npm pack tar -tzf <package-id>.tgz 回答1: As Mike 'Pomax' Kamermans mentioned in comment the fact that .npmignore and .gitignore use the same syntax can be leveraged: git ls-files -co --exclude-per-directory=.npmignore The

Should I .npmignore my tests?

僤鯓⒐⒋嵵緔 提交于 2019-12-17 15:28:15
问题 What exactly should I put in .npmignore ? Tests? Stuff like .travis.yml , .jshintrc ? Anything that isn't needed when running the module (except the readme)? I can't find any guidance on this. 回答1: As you probably found, NPM doesn't really state specifically what should go in there, rather they have a list of ignored-by-default files. Many people don't even use it as everything in your .gitignore is ignored in npm by default if .npmignore doesn't exist. Additionally, many files are already

Should package-lock.json also be published?

早过忘川 提交于 2019-11-30 11:03:39
npm 5 introduced package-lock.json , of which the documentation is here . It states that the file is intended to be included with version control, so anyone cloning your package and installing it will have the same dependency versions. In other words, you should not add it to your .gitignore file. What it does not state is wether or not the file is intended to be included with a published package. This question could be rephrased as; should package-lock.json be included in .npmignore? It cannot be published. From the npm documentation: One key detail about package-lock.json is that it cannot

Should package-lock.json also be published?

假装没事ソ 提交于 2019-11-29 16:35:57
问题 npm 5 introduced package-lock.json , of which the documentation is here. It states that the file is intended to be included with version control, so anyone cloning your package and installing it will have the same dependency versions. In other words, you should not add it to your .gitignore file. What it does not state is wether or not the file is intended to be included with a published package. This question could be rephrased as; should package-lock.json be included in .npmignore? 回答1: It

Should I .npmignore my tests?

元气小坏坏 提交于 2019-11-27 17:56:00
What exactly should I put in .npmignore ? Tests? Stuff like .travis.yml , .jshintrc ? Anything that isn't needed when running the module (except the readme)? I can't find any guidance on this. SamT As you probably found, NPM doesn't really state specifically what should go in there, rather they have a list of ignored-by-default files . Many people don't even use it as everything in your .gitignore is ignored in npm by default if .npmignore doesn't exist. Additionally, many files are already ignored by default regardless of settings and some files are always excluded from being ignored, as