Grunt-Impact is a Grunt build system for all your ImpactJS games. It aims to streamline baking and deployment to a few keystrokes.
Before you do anything else, you must have nodejs installed.
Once nodejs is installed, copy Gruntfile.js, excludes and package.json to your ImpactJS directory, and then go to the root of your ImpactJS game directory and run the following commands:
npm install -g grunt-cli
npm install
This will install grunt and then install all devDependencies specified in the package.json.
After running the commands you need to take a look at the package.json file and update the commented items to your local configuration.
And that's it!
Now you will have all the available commands listed below that can be run from the root of your ImpactJS game directory.
grunt bake
- bakes your gamegrunt build
- bakes and uglifies your gamegrunt cocoon
- deploys a zip to a connected android phone for use with CocoonJSgrunt deploy
- deploys your game to a remote server (settings in package.json)grunt expose
- replace all occurrences of ig with window.ig to expose ig globally for compilation purposesgrunt inject
- injects minified script tags into your html files (specified in package.json) and removes the impact dev script tagsgrunt prepare
- bakes, uglifies and injectsgrunt publish
- bakes, uglifies, injects, deploys and revertsgrunt revert
- removes the minified script tags from your html files (specified in package.json) and injects the impact dev script tagsgrunt uglify
- uglifies the baked file
If you run grunt
by itself, it'll do the same as grunt build
.
That's up to you! This Grunt configuration is by no means exhaustive to the ImpactJS community needs. Please feel free to offer up suggestions and pull requests to make Grunt-Impact better!