Yuki

Members
  • Content Count

    2
  • Joined

  • Last visited

  1. Yuki

    How to export Phaser with ES6 syntax

    Thanks for your reply. I searched some boilerplates you mentioned. And I found phaser-es6-webpack seems good to me since it has ES6 syntax and provides a kind of convention of phaser game. And also, the project seems still active. I would explore this and if I feel it too complex, I shall take Phaser global as you recommended. Thanks a lot!
  2. I've just tried to import phaser.js along this MDN document. But it raises errors no matter how the import statement is applied. import Phaser from './phaser.js'; => Uncaught SyntaxError: The requested module does not provide an export named 'default' import {Phaser} from './phaser.js'; => Uncaught SyntaxError: The requested module does not provide an export named 'Phaser' import * as phaser from './phaser.js'; => Uncaught TypeError: Cannot set property 'PIXI' of undefined It seems phaser.js doesn't have the export statements. So, could someone advise me how to add an export statement to phaser.js so that it can be imported by other modules?