This is my projects structure in Webstorm
if I import Objects.js by this line it works
import * as Objects from "../../ecosystem/js/world/Objects.js";
but if I swtich to any of these
import * as Objects from "../js/world/Objects.js";
import * as Objects from "./js/world/Objects.js";
import * as Objects from "js/world/Objects.js";
It doesnt work and gives error GET http://localhost:63342/js/world/Objects.js net::ERR_ABORTED 404 (Not Found)
I suspect this is because the network request is Request URL: http://localhost:63342/js/world/Objects.js
which lacks ecosystem folder. How can I solve this in a clean way?
I create classes and export them at the end of Objects.js
file as follows.
I looked into these links but still couldn't solve my issue:
Import doesn't work when using relative path. JavaScript
How do I include a JavaScript file in another JavaScript file?
export {Sphere, LightIndicator, MouseFollower, Terrain, Box};