[remove]
Initial Setup
This set up is for static sites and not initailly set up to handle dynamic sites. It can be retro fitted to make that happen, but it is not the case now.
- Update project name in /README.md
- Update project name in /package.json
[/remove]
[Project Name]
[ADD SHORT DISCRIPTION OF PROJECT]
Requirements
Quick Start
- run
npm install -g grunt grunt-cli
(can skip if you've already got them installed) - run
npm install
(you may need to dosudo npm install
due to the execSync module) - run
grunt serve
while developing (see below for info ongrunt serve
)
Development Notes
A few quick reminders as you are developing.
- Absolutely no compiled files should be committed to git. If a compiled file is showing in
git status
, add it to the ignore file. - Use bower for all libraries accessible via git. Using
grunt bowercopy:dev
orgrunt bowercopy:dist
will move those libraries' assets to the correct location. bower_components
is an import path for SASS/Compass.- Boilerplate contains Lodash and not Underscore or Lodash version of Underscore, so all Lodash methods are available when required.
- Accessibility checklist.
- HTML5 Elements on MDN
- Custom Tiles in IE11 on MSDN, covers the use of browserconfig.xml in customizing the display of a pinned site in IE11/Win8+
Modernizr
Boilerplate has a custom builder of Modernizr that will allow you to add your own tests. Please update Gruntconfig.js
with tests that are needed instead of loading the whole development version. See https://github.com/Modernizr/grunt-modernizr for more settings.
This approach will limit the Modernizr tests to only those needed for the project. As a benefit we prevent running every Modernizr test on every page load of the site.
BrowserSync
BroswerSync.io is included as a grunt task to serve up the site, update it when changes are made, and assist in testing. It includes an additional UI with different toggles for testing. The URL for the UI is printed with the development URL when grunt serve is initially run.
Grunt Tasks
All :dev
grunt tasks are for local development and all :dist
are used for distribution builds.
grunt serve
- Will set up everything for local development including live reloadgrunt dist
- Will compile the entired codebase for dev, stg, prod, or deliverablegrunt bowercopy
- Moves files installed viabower install
to their correct locationsgrunt bowercopy:dev
grunt bowercopy:dist
grunt browserSync:dev
- Serves up static files and displays local and external addressgrunt clean
- Cleans up the.tmp
anddist
foldersgrunt clean:dev
grunt clean:dist
grunt compass
- Compiles Sass files tp.tmp/cssgen
. Sets import path to includebower_components
grunt compass:dev
grunt compass:dist
grunt concat
*grunt concurrent
- Runs multiple grunt tasks at the same time to speed up buildsgrunt concurrent:dev
- Fires off nothing atmgrunt concurrent:dist
- Fires offimagemin:dist
,svgmin:dist
,cssmin:dist
,htmlmin:dist
grunt copy
- Copies all needed files to correct locationsgrunt copy:dev
grunt copy:dist
- copies overrobots.txt
andfavicon.ico
to thedist
folder
grunt htmlmin:dist
- Minifies html files fromsource
and saves todist
grunt imagemin:dist
- Minifies gif, jpeg, jpg, and png fromsource
and saves todist
grunt jscs
- Checks all JavaScript to ensure it all matches standards set in the.jscs.json
filegrunt jshint
- Checks all JavaScript to ensure code qualitygrunt lodash
- Builds a custom lodash file based ongrunt modernizr
- Builds out a lean version of Modernizr based on the settings found inGruntconfig.js
grunt modernizr:dev
- Compiles modernizr based on theGruntconfig.js
grunt modernizr:dist
- Compiles modernizr based on theGruntconfig.js
but uglified
grunt requirejs
- Runs through all JavaScript files and merges all dependencies to a single file. As the project grows, modules should be created to lesson the chances of have large JavaScript filesgrunt svgmin:dist
- Minifies svg fromsource
and saves todist
grunt usebanner
- adds a banner to the top of each file that is created*grunt usebanner:distjs
- adds a banner to JavaScript filesgrunt usebanner:distcss
- adds a banner to CSS filesgrunt usebanner:disthtml
- adds a banner to HTML files
* Not implimented in Gruntfile.js