Tasks

grunt or grunt default will lint, concat and minify both CSS and JS by default.

grunt minify will run the default task above and compress images with Yahoo! SmushIt.

grunt watch is not a custom task, but intended to run while developing to see live linting and minification results.

Grunt watch is truly where the power of Grunt shines as the default task is ran after each watched file is changed. See the quick tutorial below to learn more.

Understanding The Watch Task

Open up a command line instance and navigate to the project directory where Grunt is set up.

Run grunt or grunt default, note the output.

Run grunt watch from the command line. Grunt is now running the watch task and waiting.

Open /css/custom/style.css or /js/custom/scripts.js in your favorite code editor and save the file.

Go back to the command line where watch is running and note the output, the same as running the default task.

Success! The default task is ran every time a watched file is changed.

GruntStart Architecture Decisions and Advanced Usage

GruntStart utilizes a flat directory structure within /js/ and /css/ to solve path-ing issues for media that arise in CSS or Javascript development. The multiple directories within /css/ and /js/ allow flexibility for a wide range of development approaches.

The /css/libs/ and /js/libs/ directories have a z.style.concat.js and z.scripts.concat.js. These are the files concatenated from /custom/ by GruntStart. The 'z' prefix is there to make sure the custom code is included after any plugin or library code. Again this provides flexibility and solves a few problems, one of which is ordering what code comes first.

In the future a custom Grunt task could solve this problem. Until then, to gain further control of file order you will have to re-work the grunt.js configuration specifically to your project.

Project Goal and Future

Provide a quick and easy solution for developers to lint and minify their code. The goal is to branch and extend this base setup for other starter projects such as Twitter Bootstrap, Foundation and more. Feel free to contribute, Pull Requests will be accepted for improvements to the base setup and framework specific branches.

Remember, this is a start. From here you can mold and shape it to fit your approach.