Phaser + Spine in single file -> how is this possible?

Hi! I’m making a test, playable game (Phaser + Spine, assembly into one index.html should be). What I use is on the screen;

Problem:
Spine animations (in .atlas, .json, .png formats) work in dev mode, but after the build (vite build) the character is not displayed, because the .atlas file contains a link to .png, but this link is not converted to base64 during the build. As a result, after the build, atlas cannot find the image.

I’ve already tried:

  • Manually insert base64 into HTML (partially works, cumbersome).

  • Tried with phaser cache and imports via atlas?raw, but it didn’t work, a rather specific approach.

Question:
How to properly load spine animation in Phaser + spine-phaser-v4 so that it:

  1. Works after assembly (in one HTML file),
  2. Pulls .png from .atlas (or its base64 equivalent),
  3. Does not require manual insertion of base64 into HTML

Maybe there is a spine+phaser project template, where the build goes to 1 index.html and png links from the spine atlas work correctly? :melting_face:

Previously, I would export animations from Spine and repack them using Free Texture Packer .
This is merely a workaround , not a fundamental solution, but it works. Hope this approach helps .

and then create animation in Scene: