Bedrock provides a Gruntfile.js in the root of the project to make local development easier, by automating common tasks such as:
- Compiling CSS when a LESS file changes.
In order to get started, you'll want to install Grunt's command line interface (CLI) globally. You may need to use sudo (for OSX, *nix, BSD etc) or run your command shell as Administrator (for Windows) to do this:
npm install -g grunt-cli
You may also want to install JSHint globally using:
npm install -g jshint
Finally, install the dependencies that the bedrock Gruntfile needs:
To start the grunt task runner, simply run:
To enable live-reload in the browser you must set USE_GRUNT_LIVERELOAD to True in bedrock/settings/local.py:
USE_GRUNT_LIVERELOAD = True
In the root directory you will also find a .jshintrc-dist file which contains a basic set of defaults for running JSHint. If you wish to use these defaults with Grunt then copy the contents to a local .jshintrc file:
cp .jshintrc-dist .jshintrc
To perform a single run of the test suite, type the following command:
The Tabzilla tests require that you have your local bedrock development server running on port 8000.
Cleaning generated CSS files
Bedrock uses Less to generate CSS files. Sometimes during development you may want to clear out your cached CSS that gets generated. To make this easier, you can clear all *.less.css files located in media/css/ directories with the following command: