-
Notifications
You must be signed in to change notification settings - Fork 555
Building
mucaho edited this page May 20, 2017
·
15 revisions
These instructions assume you've already cloned the Crafty repo on your machine, and are for developers interested in contributing to the project. Others can just download the most recent versions of Crafty here.
This uses node and GruntJS. To get started
- If necessary, install node and its package manager npm. Crafty is currently tested with node v6.
- Use npm to globally install the grunt commandline tool:
npm install grunt-cli -g
. (You might need elevated permissions for a global install.) - Install the packages Crafty uses to build by running
npm install
in Crafty's root directory. (The one withpackage.json
.) This step will pull in about 30MB of required node modules and their dependencies, and place them in thenode_modules
directory of the project.
Note: You can also use yarn instead of npm, and indeed it's a bit faster. Using yarn will also guarantee you get the package versions specified in the yarn.lock
file.
That's it! Now you can use these commands:
-
grunt
: builds crafty.js and validates it. -
grunt api
: builds the documentation -
grunt view-api
: builds the documentation, and opens it in your default browser -
grunt check
: runs tests and lints -
grunt uglify
: minifies crafty.js -
grunt release
: builds crafty.js, crafty-min.js, and the documentation