Create Phaser projects with no build configuration.
In order to use Phaser CLI you need to have Node.js (>= 6) installed.
Run the following commands to install Phaser CLI and create a new project. This
will create a new folder matching the specified
project-name and will generate
all the required files.
Currently the only boilerplate available to use is TypeScript, but this may change in the future.
npm install -g @phaser-cli/cli # or yarn global add @phaser-cli/cli phaser create <project-name>
Running in Development
Running the following command will serve your project to localhost:8080.
If you wish to change the host or the port of the dev server you can prepend the
PORT=3000, replacing the example values with
Building for Production
The following command will build your game for production, bundling code and
assets into the
npm run build
You also have the option to eject from phaser-cli allowing you to customise webpack and other config to your heart's content. This is not recommended unless you really need to change something.
Note: You will no longer receive updates through the @phaser-cli/scripts package if you choose to eject.
npm run eject