Webpack question about in-lining assets

Hello,
I would like to inline all the assets that I use in my project. These assets are loaded async by using methods like:
BABYLON.SceneLoader.Load(“Assets/Scenes/”, “scene.babylon”, engine, function (scene) {
});
Or like:
new BABYLON.Texture(“Assets/Textures/checkered_texture.png”, scene);

My goal is to inline all of the assets (.gltf, .babylon, texture .pngs) in the .html file.
I’m looking for pointers on how can I do it with webpack ? or any other build tool.

Got an idea from Using External Assets - Babylon.js Documentation but I’m not sure how to do that with webpack.

Thanks a lot.

Well, if you import an image with webpack, I think you will get the base64 version right?
Then you can load it like that:
https://www.babylonjs-playground.com/#0ZB1A3#13

1 Like