Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorJoshua Chaitin-Pollak <jbcpollak@users.noreply.github.com>2016-12-16 00:08:26 +0300
committerRebecca Turner <me@re-becca.org>2017-08-13 03:05:07 +0300
commita0fdd15710971234cbc57086cd1a4dc037a39471 (patch)
tree2885ef33cd59588030e329ff01267450f6399b37 /doc
parent7a7710ba72e6f82414653c2e7e91fea9a1aba7e2 (diff)
doc: Clarify the behavior of the `files` array in the package-json docs
Credit: @jbcpollak Reviewed-By: @iarna PR-URL: https://github.com/npm/npm/pull/15234
Diffstat (limited to 'doc')
-rw-r--r--doc/files/package.json.md13
1 files changed, 8 insertions, 5 deletions
diff --git a/doc/files/package.json.md b/doc/files/package.json.md
index 1b2b04fe2..ddfbbe4c0 100644
--- a/doc/files/package.json.md
+++ b/doc/files/package.json.md
@@ -170,12 +170,15 @@ npm also sets a top-level "maintainers" field with your npm user info.
The "files" field is an array of files to include in your project. If
you name a folder in the array, then it will also include the files
-inside that folder. (Unless they would be ignored by another rule.)
+inside that folder. (Unless they would be ignored by another rule in this section.)
-You can also provide a ".npmignore" file in the root of your package or
-in subdirectories, which will keep files from being included, even
-if they would be picked up by the files array. The `.npmignore` file
-works just like a `.gitignore`.
+You can also provide a `.npmignore` file in the root of your package or
+in subdirectories, which will keep files from being included. The `.npmignore`
+file works just like a `.gitignore`. If there is a `.gitignore`
+file, and `.npmignore` is missing, `.gitignore`'s contents will be used instead.
+
+Files included with the "package.json#files" field _cannot_ be excluded through
+`.npmignore` or `.gitignore`.
Certain files are always included, regardless of settings: