This could be a very niche topic but just recently I had a project that required me to use Webpack, and to my surprise, there are not many clear and definitive guides in how to upload a game made in phaser (and Webpack) to Heroku.

You can host your own server and do all the required stuff to run a game using only Webpack, so there’s no reason to hassle and smash your head to the keyboard in trying to make your phaser game run with Express.

So this time I’ll try to write a special tutorial that can be easily understandable and anyone with a little experience with Javascript (and JSON) can follow.

_First Step _

Let’s start with downloading the materials we are going to use for this guide.

We need a template with Webpack that we can download here. No need to do the tutorial but I strongly recommend it in case you have some questions.

Next, we have to create an account with Heroku and download Heroku CLI.

If you use Linux, you can simply install it with this line:

sudo snap install --classic heroku

and on macOS:

brew tap heroku/brew && brew install heroku

For windows, you’re going to need to visit the website and download it.

Next, once you finish installing the Heroku CLI you’re gonna require to login to your Heroku account using your terminal.

heroku login

After login and inside of the directory of your game application, we are going to create a new Heroku app:

heroku create phaserGameName

Just add any name you want to use for your game application, so you can remember it.

#heroku #expressjs #javascript #json #phaserjs

How to Upload a Phaser Game with Webpack to Heroku
4.00 GEEK