How to load a obj/babylon/gltf file while using parcel bundler

Hi I am building using parcel bundler and everything worked fine. I was even able to load Skybox CubeTexture files with the help of CreateFromImages static method from CubeTexture. As I am simply import the Image using the import keyword and just pass it in.

But it doesnt seems to be the case for Mesh Loading.

Please let me know how to Load a Mesh just by simply importing using the import keyword.

PS: Parcel is able to import using the Import keyword. Only needed a way to load it into the scene.

EDIT: Does anyone know how to do it?

Could you share your repo as a start point to help the community digging into the issue ?

@sebavan Here is my link to the repo

I am using Parcel-bundler to bundle babylon js but parcel requires absolute imports to be mentioned in the js file so no internal file loading like we specify in SceneLoader or AssetManager will work. But parcel can import the .babbylon file with no issues so there should be an API to simply pass in the imported variable and create a mesh out of it and place it in the scene

Let s check if other Babylonians are using Parcel in order to help :slight_smile:

Thanks for the repro.

@sebavan Unfortunately from what I have asked around the community and discord no one seems to use parcel bundler. Provided such as easy to use bundler I am surprised to see no one is still adapting to parcel bundler. Will raise a ticket on github issues to see if someone else can help me.

1 Like

You should try on the parcel repo you might have better chances there. The think is you should not bundle the assets and it might be better to keep them aside of your bundle statically served ?

Guess I have to just stick with webpack and just move on :frowning:

@sebavan I have figured out how to load static files using parcel bundler. I used the below plugin to simply copy to my dist folder while parcel bundles.

I have it working perfectly in my repo.