We highly recommend including the .nowignore
file in your Now deployment. It is essential in uploading only the required paths to Now, increasing the speed of the initial deployment process.
In this document, you will learn the file's exact function and how to use it.
What Files Are Uploaded
By default, all files within your project are uploaded (not served, just uploaded) to Now.
In order to prevent a path within your project from being uploaded to Now, you need to create a .nowignore
file and add the path that you would like to ignore.
The syntax of a .nowignore
file is exactly the same as a .gitignore
file (you can find the full specification here). As an example, this is how .nowignore
would look if you wanted to prevent the directories node_modules
and dist
from being uploaded:
node_modules dist
An example .nowignore
file, preventing the node_modules
and dist
directories from being uploaded.
We highly recommend taking advantage of this system for ignoring paths, as it will make creating deployments both faster and cheaper.
What Files Are Served
Only files that are matched by the src
property of a Build are "considered for serving", the Builder you defined decides whether a file is then actually served.
If you did not define a now.json
file containing one or more Builds, however, all files within your project will be served.
The only exceptions are now.json
and .nowignore
, which will not be served if you did not explicitly define a Build with a src
property that matches their names.
Read More
See the documentation on Deployment Basics, Builds and Builders to learn more: