Phaser 3: ES6 Webpack Project Template

Leave a comment Standard

So I’ve been playing around with Phaser 3 a lot lately and one of the biggest issues for me was getting it up and running with Babel and Webpack along with writing unit tests and jsdoc and all that fun stuff. Hence why I decided to make this nice little project template repo that you can use to start development on your own Phaser 3 game.

Grab the code here: https://github.com/design1online/phaser3-es6-webpack-template

Phaser 3 Webpack ES6 Project Template

A Phaser 3 project template using webpack, SASS, Babel ES6, and eslint set to use the airbnb preset. It also includes a folder of example scripts to help start your development.

Requirements

We need Node.js to install and run scripts.

Setup & Development Commands

Run the appropriate command in your terminal:

Command Description
npm install Install dependencies and launch browser with examples.
yarn start Launch browser to show the examples.
Press Ctrl + c to kill http-server process.
yarn deploy Create a distributed version of the build that’s minified and uglified.
yarn lint Run the linter, defaults to using airbnb style guide (https://github.com/airbnb/javascript).
yarn lint:fix-dry-run Run the linter and automatically fix without saving changes.
yarn lint:fix Run the linter and automatically fix problems and save changes.
yarn test Run the unit tests. Looks for files matching the pattern *.test.js.
yarn test:watch Run the unit tests but keep watch for changes.
Press Ctrl + c to kill the watch process.

Grab the Code

https://github.com/design1online/phaser3-es6-webpack-template

Advertisements