Next.js, Phaser and providing relative paths to files?
Unanswered
Common Murre posted this in #help-forum
Common MurreOP
I noticed while trying to integrate Phaser with my Next.js application that it appears Next causes a lot of weirdness when trying to provide relative file paths for Phaser's components to use.
For example, when one of my scene
Importing
For example, when one of my scene
.tx files are in the same directory as one of my sprites, TILE.png, providing a function that wants TILE.png with the relative path 'TILE.png' doesn't work, nor does it work if I try to give the relative path from the project directory.Importing
TILE.png in the .tx file as an object and using the directory given from .src DOES work, though (giving some path like /_next/static/media/TILE.18a9e25a.png instead of my original file). This is good, but not every file that I need to provide to Phaser can be imported in this way (or comes with a method to provide a path like this). Is there any way around this, or any more direct way to make other files more accessible to my scripts to be pathed to?