My base build project utlising NPM and Grunt, Sass, Compass, Image spriting
JS hint, CSS lint, JS Uglify, concat and all the lovely tools I like to use.
-
Make sure you have latest version of Compass installed. If its not installed, visit the website
for more details: http://compass-style.org/install/ -
Install node dependencies using the following command:
npm install
-
Install susy:
gem install susy
-
The
src
folder is where all working styles/scripts/png images will be placed. Theassets
folder is where all compiled code will be dropped. This is the only folder you will need when deploying a site using eureka-build. -
To compile your code, run one of the following commands:
grunt development
grunt build
-
The watch command will look for changes made to your styles, scripts or pngs placed in the sprite folder:
grunt watch
Usectrl+c
to cancel this command -
To add more js libraries, drop them into the
libs
folder and then add them to the grunt file in thejsFileList
array. They will be compiled into a js file calledbuild.js
.
7. All pngs that you want to be sprited, need to be dropped into the sprites folder located src/images/sprites/
. They will then be combined into a sprite png located in the assets
folder along with the relevant Sass code
located in the sprite style sheet _sprite.scss
.
=================
Thats it! Have fun and feel free to suggest more useful web development libraries.
Credit:
- Sass http://sass-lang.com/
- Grunt http://gruntjs.com/
- Compass http://compass-style.org
- Sprite smith https://github.com/Ensighten/grunt-spritesmith
- Uglify https://www.npmjs.org/package/grunt-contrib-uglify
- Watch https://github.com/gruntjs/grunt-contrib-watch
- Concatenate https://github.com/gruntjs/grunt-contrib-concat
- JSHint https://github.com/gruntjs/grunt-contrib-jshint
- CSSLint https://github.com/gruntjs/grunt-contrib-csslint
- Susy http://susy.oddbird.net/
More info can be found here: www.andrew-cocker.co.uk