Is there something like a “webpack loader” to load
.babylon files relative instead of import from the absolute path while using CRA/NextJs/Vue and so on?
What I want to reach with this is separate the meshes used on the scene by “component” just like we separate components with some UI frameworks or when use DDD.
To make me more clear, lets suppose I have 2 scenes, scene 1 and 2. I want to have a folder named
scenes, inside this
scenes folder I want 2 another folders
scene-2, inside each scene folder I would like to create another folder named
meshes and there store all the meshes of the current scene.
Something like this:
src/ --| scenes/ ----| scene-1/ ------| index.tsx ------| meshes/ --------| mesh-1.babylon --------| mesh-2.babylon ----| scene-2/ ------| index.tsx ------| meshes/ --------| mesh-1.babylon --------| mesh-2.babylon
I want this just because I like this kind of file organization and I wanted to know if its possible and how can I do something like this
index.tsx files would have something like this inside it:
SceneLoader.ImportMeshAsync("mesh-name", './meshes/', "mesh-1.babylon", scene) but I know that webpack loaders don’t work exactly like this, maybe I should import it like a NPM module what isn’t a issue at all if its possible.