Clone or download this repository and install its dependencies:
git clone https://github.com/samme/phaser-rollup.git my-phaser-game
# OR
npx degit "samme/phaser-rollup" my-phaser-game
cd my-phaser-game
npm install
npm run devnpm run buildbuilds the application topublic/bundle.js, along with a sourcemap file for debugging.npm startlaunches a server, using serve.npm run watchwill continually rebuild the application as your source files change.npm run devwill runnpm startandnpm run watchin parallel.
Set build constants in replace() in rollup.config.js.
Copy and modify node_modules/phaser/src/phaser.js, then alias phaser in rollup.config.js:
alias({
entries: {
phaser: 'src/phaser-custom.js'
}
})MIT.