Webpack loader for .env file

Fixed!!!

After I imported babylonjs envTextureLoader and used file-loader, the only issue was that there was a 404 and the asset couldn’t be found. What was happening was that webpack was trying to reach “localhost:/js123456789.env” for example instead of “localhost:/js/123456789.env”.

I changed a section in the webpack config file, and the browser can retrieve the env file.

Thank you all for the help!

2 Likes