XmlLoader from localhost return 404

Hi All, @RaananW ,
I’ve been using the great template to create a typescript project on Babylon that @RaananW has created,
GitHub - RaananW/babylonjs-webpack-es6: Babylon.js basic scene with typescript, webpack, es6 modules, editorconfig, eslint, hot loading and more. Will even make coffee if you ask nicely. (should be official IMO),

The problem is when trying to load a local xml file with XmlLoader....loadLayout("src/layouts/ui_editMesh.xml" ...
I keep getting https://localhost:8080/src/layouts/ui_editMesh.xml 404 (Not Found)

I tried adding xml declaration in the externalFileTypes.d.ts file (without understanding too much why :blush: ) but it didn’t help.

Any suggestions would be really appreciated.

public files like static xmls or media you don’t want to bundle should sit where index.html sits, which is a public static directory. If you want to bundle this XML you will need to also provide an xml loader in the webpack configuration.
If it’s too abstract let me know :slight_smile:

Keeping the xml in the public folder should be good enough.

Can you please suggest what configuration needs to be done in the config files in addition to that?

in that case there is no need for extra configuration, just put it there. the base of this directory will be served at localhost:8080/

1 Like

works like a charm, thanks.

I’ll be happy to be referred to additional reading on how to achieve this with the:

xml loader in the webpack configuration

Here you go: