-
Notifications
You must be signed in to change notification settings - Fork 0
Grunt Toolkit
Ghost has a number of tasks which are automated via Grunt. The following document explains what each thing does. You can also get help when running grunt by typing grunt --help
The default grunt task does two things:
- compile sass into css
- compile the templates in
core/client/tplinto thehbs-tpl.jsfile
These are commonly needed after pulling changes from master, so it's recommended to always do it after a pull as a matter of habit.
If you have a fresh repo and are running grunt for the first time, you'll need to run grunt init rather than just grunt as this also installs bourbon. This only has to be done once on a repo.
grunt validate runs all of Ghost's test suites: jsLint, unit tests (mocha), integration tests (mocha with DB access), api functional tests (mocha) and interface functional tests (CasperJS).
This can take a while, so it makes sense to run the individual sections if you're working on specific things.
-
grunt jslint- run just the linter -
grunt test-unit- run all of the unit tests, seemochacliconfig inGruntfile.jsfor a full set of the individual groups of unit tests which can be run and feel free to add your own. -
grunt test-integration- run the database integration tests -
grunt test-api- run the api functional tests -
grunt test-functional- run the interface functional tests (both admin and theme). You can further specify which folder or file of functional tests you want to ring by specifying a--target, e.g.grunt test-functional --target=admin/
The grunt prod task goes one step beyond the default grunt task and minifies the Ghost JavaScript source for production via an additional uglify task.
When you're ready to deploy to production, running grunt prod first is a wise choice.