A pipeline for importing assets into a Phaser project
npm i phaser-import-pipeline
Via CLI:
$ ./node_modules/.bin/phaser-import-pipeline
Via npm script:
{
"scripts": {
"import": "phaser-import-pipeline"
}
}
no args
run copy process (cleanup filenames, add to manifest)watch
watch directories, run base cmdCan be set using a .pipelinerc
file. With sample contents:
{
"sourceDir": "source",
"destDir": "assets",
"manifestPath": "assets/manifest.json",
"deleteOriginal": true
}
spritesheet
includes the following default manifest data
{
"frameWidth": 0,
"frameHeight": 0
}
audio
supports multiple file formats (the largest file will be used for manifest size calculation)
{
"door_close": {
"file": ["door_close.mp3", "door_close.ogg"],
"size": 314500
}
}
manifest.json
{
"assetRoot": "assets",
"totalSize": 420615,
"assets": {
"image": {
"house": {
"file": "house.png",
"size": 2975
},
"person": {
"file": "person.jpg",
"size": 66520
}
},
"audio": {
"door_close": {
"file": "door_close.mp3",
"size": 314500
}
}
}
}