HTML and CSS Reference
In-Depth Information
Figure 4-6. Running grunt init:gruntfile from Terminal
Each time grunt runs, it looks in the current directory for a file named
grunt.js
. If this
file is not found, grunt continues looking in parent directories until that file is found.
This file is typically placed in the root of your project repository, and is a valid JavaScript
file composed of three parts:
• Project configuration
• Loading grunt plug-ins or tasks folders
• Tasks and helpers
This is what the
grunt.js
looks like for the
slidfast.js
JavaScript project (which only in‐
cludes HTML, CSS, and JavaScript files):
/*global module:false*/
module
.
exports
=
function
(
grunt
)
{
// Project configuration.
grunt
.
initConfig
({
meta
:
{
version
:
'0.1.0'
,
banner
:
'/*! PROJECT_NAME - v<%= meta.version %> - '
+
'<%= grunt.template.today("yyyy-mm-dd") %>\n'
+
'* http://PROJECT_WEBSITE/\n'
+
'* Copyright (c) <%= grunt.template.today("yyyy") %> '
+
'YOUR_NAME; Licensed MIT */'
},
lint
:
{
files
:
[
'grunt.js'
,
'slidfast.js'
]
},
// qunit: {