edit

Configuration

Phaser Node Kit configuration options are minimal. You can however ignore files, directories, and extensions, as well as adjust some of the watcher settings.

pnkit.json

The Phaser Node Kit configuration can be found in the pnkit.json file at the root your project directory. This file is fairly critical to the kit's operation. You should keep it with the project.

The default configuration file looks like so:

{
  "ignore": [ ".DS_Store" ],
  "watch": {
    "port": 5550,
    "host": "127.0.0.1",
    "refresh": true,
    "startBrowser" : true
  },
  "debug": true
}

Configuration Keys

ignore

You can fill this array with folders, files, and extension types that you would like the watcher to ignore.

For example:

{
  "ignore": [".tps", "stuff", "secret.json"] 
}

watch

This watch section contains settings for the watcher.

port

The port to serve the "live" game build on. The default is 5550.

host

The host to serve the "live" game build on. Change this to test the build over your local network. The default is 127.0.0.1.

refresh

Whether to refresh the browser automatically on updates to the project. If you set this to false, you will need to remember to refresh your browser to see the current build. The default is true.

startBrowser

Whether to start the browser automatically when running watch. The default is true.

debug

The debug key is a boolean value. If set to true, then the bundle will also contain inline source maps, making it easier to debug your code. If false no source maps are generated.

Make sure to set debug to false when making your final build. This makes the bundle leaner.


If you change the configuration while the watcher is running, be sure to stop and restart it to make the configuration active.