Prevent Uploading Source Paths with `.nowignore` on ZEIT Now

Use a .nowignore file to prevent the uploading of source paths when deploying with ZEIT Now.

ZEIT Now supports configuration required to ignore source files and paths within your project. With a .nowignore file in your project directory, a source path can be prevented from being uploaded to Now.

File Syntax

The syntax of a .nowignore file matches that of the popular .gitignore file used in ignoring files when uploading to a Git repository.

An example of a .nowignore file that prevents an /image directory and /private.html file within a project from being uploaded to ZEIT Now would look like this:

image
private.html

An example .nowignore file.

Uploaded Files

Aside from the default exclusions, all files within your project are uploaded to ZEIT Now if no source path is specified to be excluded in a .nowignore configuration file.

Note: You can find the complete list of files and directories excluded by default in the ZEIT Now documentation.

Worthy of note is that not all uploaded files are served on ZEIT Now. So, what files are served?

Served Files

If ZEIT Now is required to build your project, the non-targeted files are prevented from being deployed and served on ZEIT Now.

The use of a .nowignore configuration file allows you to keep private files safe and also makes your deployment faster by uploading only the essential files.



Written By
Written by unicodeveloper, msweeneydevunicodeveloper, msweeneydev
on January 24th 2019