generator-phaser-gulp-typescript
v0.2.3
Published
Yeoman generator for a typescript game using phaser js
Readme
generator-phaser-gulp-typescript
This generator will get you started in with Phaser in typescript with a clean gulp build in seconds !
You will get :
- Livereload
- Autocompletion thanks to typescript definitions files
- Typescript debugging in your browser with source maps
The current version works with Phaser 2.3.0 and typescript 1.4!
Getting Started
Install Yeoman :
$ npm install -g yoInstall the generator :
$ npm install -g generator-phaser-gulp-typescriptLaunch the generator:
$ yo phaser-gulp-typescriptGulp
Run & debug (live reload and source maps)
gulpBuild (minified js and less) :
gulp buildDeploy on gh-pages.
You will need to setup the gh-page branch as instructed here.
First build, then :
gulp deployGotchas
The typescript task needs to have the definitions in the src/scripts/definitions. This will make the compilation much faster. You can find these definitions in the phaser-official bower dependencies or on the Phaser repository.
By default, the generator will try to copy those definitions but you may have to do this yourself in case of error.
In IntelliJ or WebStorm, having duplicated definitions will can cause problems.
I recommend deleting the definitions folder of vendor/phaser-official.
It's a bower dependency so you can regenerate them at will.
License
MIT
Credits
This generator was inspired by the generator-phaser-typescript
