Hello! How can I add files (such as .png, .obj (3d model)) in webpack and use their paths in code? As reference, I use this project without any changes to config. In local experiments, I start a local server and get files by paths ""
http://127.0.0.1:5500/my_file.png▾
". Is there a similar way?
t
turansky
08/19/2021, 6:46 PM
Do you want to embed files inside js script?
turansky
08/19/2021, 6:47 PM
Or you want to have static assets?
n
Nikolai Sviridov
08/19/2021, 7:06 PM
In js it looks like this.
Copy code
const textureLoader = new THREE.TextureLoader();
const blocksBaseColor = textureLoader.load("<http://127.0.0.1:5500/textures/blocks-basecolor.jpg>");