Recently, I've been working on setting up babylonjs through npm
. Starting with a new project, I ran npm init
and then proceeded to install babylonjs using npm install babylonjs --save
, following the provided documentation.
I then created a JavaScript file to import the module by typing
import * as BABYLON from 'babylonjs';
. However, upon checking the console, an error popped up: Uncaught SyntaxError: Cannot use import statement outside a module
.
Since I'm still relatively new to this process, I suspect that I may be missing an important step. I prefer not to rely on their CDN as I won't always have internet access.
Any help or insights would be greatly appreciated!