Using phaser with ES6, npm modules and whatnot is actually quite simple.
First, install the needed dependencies.
npm install -S expose-loader phaser-ce
Then import Phaser dependencies in the correct order.
import PIXI from 'expose-loader?PIXI!phaser-ce/build/custom/pixi.js';
import p2 from 'expose-loader?p2!phaser-ce/build/custom/p2.js';
import Phaser from 'expose-loader?Phaser!phaser-ce/build/custom/phaser-split.js';
let game = new Phaser.Game(800, 600, '', {
preload: () => {},
create: () => {},
update: () => {}
});
That's it! Time to go crazy with all the new possibilities!
No additional configurations are needed in your webpack.config or anything. It just works.