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 dev
npm run build
builds the application topublic/bundle.js
, along with a sourcemap file for debugging.npm start
launches a server, using serve.npm run watch
will continually rebuild the application as your source files change.npm run dev
will runnpm start
andnpm run watch
in 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.