What is the squarecloud.ignore file?
The squarecloud.ignore file lists the files and folders to leave out when you upload or commit an application. The Square Cloud CLI (upload, commit and zip) and the Square Cloud VS Code extension read the same file, with the same rules and the same defaults, so a project is packaged the same way by both.
It uses .gitignore syntax: comments, wildcards, folder-only and root-only rules, and ! to bring a file back.
Creating the file
Create a file namedsquarecloud.ignore in the root of your project.
The file must be named exactly
squarecloud.ignore. .gitignore is not read in its place: it often lists files the application needs to run, such as .env.Always left out
These paths are ignored before your own rules, so you don’t need to list them:node_modules.git,.githuband.vscodepackage-lock.json,pnpm-lock.yamlandyarn.lock
! rule.
Lockfiles
Lockfiles stay out of the zip by default, so Square Cloud installs your dependencies from the version ranges inpackage.json. When you need the exact versions your lockfile pins, bring it back:
Syntax
Each line is a rule. A matching file or folder is left out of the upload.
How the rules are applied:
- The last matching line wins, so put
!rules after the rules they undo. - A file inside an ignored folder can’t be brought back. To keep one file of a folder, ignore the folder’s contents (
logs/*) instead of the folder (logs/), then add!logs/keep.log. - Matching ignores case:
Dist/also matchesdist. - Only trailing spaces are trimmed from a rule, never tabs. Escape a trailing space you want to keep with
\.
Use
/ for folder separators in patterns, including on Windows.Common examples
Exclude development tools and generated files while keeping everything the application needs to run:How it is applied
The CLI and the VS Code extension readsquarecloud.ignore when preparing the files for upload or commit. Files that match a rule are left out of the zip sent to Square Cloud.
- A symbolic link to a file is uploaded as the file it points to. Links to folders and broken links are skipped.
- The CLI still reads the older names (
.squareignore,.squarecloudignoreandsquare.ignore) whensquarecloud.ignoreis missing, and asks you to rename the file.
MAIN file from your configuration file, outside the ignored paths.
The dashboard upload doesn’t read this file: when you build the zip yourself, leave those files out of it.
