It is possible to configure the Defold editor and tools to ignore files and folders in a project. This can be useful if the project contains files with file extensions which conflict with file extensions used by Defold. One such example is Go language files with the .go file extension which is the same as the editor uses for game object files.
.defignore file
The files and folders to exclude are defined in a file named .defignore in the project root. The file should list files and folders to exclude, one per line. Example:
/path/to/file.png
/otherpath
This will exclude the file /path/to/file.png and anything in the path /otherpath.
Each line must start with a / and is matched against project paths relative to the project root. A pattern matches a path if it is equal to the path or is one of its parent folders. Matching is case-sensitive.
Patterns may contain wildcards:
* matches any number of characters except /? matches exactly one character except /** matches any number of whole folders, so /**/name matches name at any depth and /folder/** matches the folder and everything inside itAll other characters are matched literally. Example:
/levels/*/tiled
/**/generated
/assets/temp_??.png
This will exclude the tiled folder in every direct subfolder of /levels (such as /levels/01/tiled), every folder named generated at any depth including /generated in the project root, and files such as /assets/temp_01.png.
.defunload file
For certain large projects that contain multiple independent modules, you may want to exclude parts of it from loading to reduce memory usage and load times in the editor. To achieve this, you can list paths to exclude from loading in a .defunload file below the project directory.
Simply put, the .defunload file allows you to hide parts of the project from the editor without making it a build error to reference the hidden resources.
The patterns in .defunload use the same rules as the .defignore file. Unloaded Collections and Game Objects will behave as if they were empty when referenced by loaded resources. Other resources that match .defunload patterns will be in an unloaded state, and cannot be viewed in the editor. However, if a resource that is loaded depends on them, the unloaded resources and their dependencies are loaded automatically.
For example, if a Sprite depends on images in an Atlas, we have to load the Atlas, or the missing image will be reported as an error. If this happens, a notification will warn the user about the situation and provide information about which unloaded resource was referenced from where.
The editor will prevent the user from adding references to .defunloaded resources from loaded resources, so this situation only occurs when resources are read from disk.
Contrary to the .defignore file, you need to restart the editor after you edit the .defunload file to see the changes take effect.