For some reason when I do var sphere = new Core(); in Game, I see Core is undefined, even though I import it:
Game.js
import Core from 'gameUnits/Core'
export class Game {
constructor() {
Core.js:
export class Core {
constructor(scene) {
}
}
When you make import without curly brackets you're trying to import default object of the module.
So, you must add
default
keyword to yourCore
exporting:OR place your
Core
importing into curly brackets:Look here for more informaction about ECMAScript 6 modules
PS: Using
default
keyword you can specify ANY name forCore
class. For example: