Phaser 3 Pack File Generator
WARNING
This project is still a work in progress. I have intentionally designed this script to not write a file. Users can produce a file through output re-direction.
What is this?
This script serves Phaser 3 developers who manage their assets with Phaser's PackFile loader. It's meant to take the load off of manually maintaining a PackFile, which becomes tedious once one is dealing with lots of assets. The product of this script is meant to adhere to the form defined in framework definition.
Features
Generates a Pack File based on organization of asset files, using a configuration file to shape output.
Usage
This script requires a configuration file following the following structure:
{
"ignoredPaths"?: string|string[]
"extensions"?: string
"options":? {
"keyFormat"?: "namespaced"|"filebasename" ,
"outputDuplicateKeyWarning"?: boolean
"applyProAssetKeyPrefix"?: boolean
"removeBaseDirFromURL"?: boolean
},
"targets": [
{
"key": string
"basePath": string
"hint"?: ["audio"|"image"|"bitmapFont"]
"extensions"?: string
"ignoredPaths"?: string|string[]
},
{
}
]
}
This script processes targets sequentially. What this means is that files found in the first target folder will not be processed a second time, even if included in the second target. This prevents double-processing, which is useful if higher-ranked target is type-hinted.
For assets that are not automatically inferred, you'll probably want to take advantage of hint options.
Invocation:
npx @paxperscientiam/generate-phaser3-filepack <configfile.json>
Example of invocation and saving (careful not overwrite unintentionally):
npx @paxperscientiam/generate-phaser3-filepack config.json > filepack.json
Notes
This script does NOT write anything to file; it's up to you to do so.
If you set a "hint", it's assumed accurate.
Auto inferred types
Hint-reliant types
Improvements
Bugs
Contributors
- All the programmers Copilot ripped off
- Fine folks at liberachat
- Phaser community