跪拜 Guibai
← All articles
Frontend

Cocos Creator Projects Keep Arriving as 1GB Zips — Here's What to Strip Out

By 亿元程序员 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Cocos Creator's auto-generated directories routinely inflate project shares to hundreds of megabytes, slowing collaboration and clogging transfer channels. Knowing which folders are disposable — and having a one-click tool to strip them — turns a recurring friction point into a non-issue.

Summary

The only directories another developer needs to open a Cocos Creator 3.x project are `assets/` and `package.json`. Everything else — `library/`, `temp/`, `local/`, `build/`, and `node_modules/` — is regenerated by the editor on first launch. Packing those folders turns a small source project into a multi-hundred-megabyte download that wastes time and bandwidth.

A new editor extension automates the cleanup. It reads the open project path, walks only a whitelist of essential directories, skips excluded folder names during recursive zipping, and writes a `{ProjectName}-min.zip` archive. The result drops a 1GB package down to a few dozen megabytes that can be shared over messaging apps.

Installation is a single folder drop into the user-level built-in extensions path (`%USERPROFILE%\.CocosCreator\builtin-extensions\3.8.7\export-min-project`), making the one-click export available across all 3.8.7 projects without per-project copying.

Takeaways
Only `assets/` and `package.json` are strictly required for Cocos Creator 3.x to recognize and open a project.
`library/`, `temp/`, `local/`, and `build/` are all regenerated by the editor and should never be included in a shared project archive.
`node_modules/` and `.git/` should also be excluded; dependency declarations stay in the project, not the installed packages.
Manually deleting these folders before zipping is error-prone — one slip deleting `assets/` or `package.json` destroys the project.
A safer manual method is to zip the whole project first, then open the archive and delete the unwanted folders from inside it.
A Cocos Creator extension automates the process via a menu command: Project → Export Streamlined Project ZIP.
The extension uses a whitelist approach, scanning only essential directories and skipping excluded names during recursive zipping.
Installing the extension to `%USERPROFILE%\.CocosCreator\builtin-extensions\3.8.7\` makes it available to all 3.8.7 projects without per-project setup.
Conclusions

Many Cocos developers treat the entire project folder as source, unaware that the editor regenerates most of it — a knowledge gap that produces routine 1GB shares for what should be 50MB transfers.

The extension's whitelist-based zipping is a safer design than deletion-based cleanup because it cannot accidentally remove `assets/` or `package.json`.

Placing the extension in the user-level built-in extensions directory rather than per-project is a deliberate choice that reduces maintenance overhead across multiple projects.

Concepts & terms
Cocos Creator project recognition
The minimum set of files the Cocos Creator editor needs to identify and open a project: an `assets/` directory containing resources and their `.meta` files, plus a `package.json` at the project root.
User-level built-in extensions path
A Cocos Creator directory (`%USERPROFILE%\.CocosCreator\builtin-extensions\<version>\`) where extensions placed are loaded for all projects using that editor version, avoiding per-project duplication.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗