Skip to content

Commit b8bc3b1

Browse files
authored
Added .defunload file documentation (#530)
1 parent 08e12dc commit b8bc3b1

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ build
33
lib/google-cloud-sdk/
44
node_modules/
55
deps/
6+
.idea/
67
.vscode/
78
.lite_project.lua

docs/en/manuals/project-defignore.md

+15-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,18 @@ The files and folders to exclude are defined in a file named `.defignore` in the
1515
/otherpath
1616
```
1717

18-
This will exclude the file `/path/to/file.png` and anything in the path `/otherpath`.
18+
This will exclude the file `/path/to/file.png` and anything in the path `/otherpath`.
19+
20+
## The `.defunload` file
21+
22+
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.
23+
24+
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.
25+
26+
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.
27+
28+
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.
29+
30+
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.
31+
32+
Contrary to the `.defignore` file, you need to restart the editor after you edit the `.defunload` file to see the changes take effect.

0 commit comments

Comments
 (0)