Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ build
lib/google-cloud-sdk/
node_modules/
deps/
.idea/
.vscode/
.lite_project.lua
16 changes: 15 additions & 1 deletion docs/en/manuals/project-defignore.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,18 @@ The files and folders to exclude are defined in a file named `.defignore` in the
/otherpath
```

This will exclude the file `/path/to/file.png` and anything in the path `/otherpath`.
This will exclude the file `/path/to/file.png` and anything in the path `/otherpath`.

## The `.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.