A website's boilerplate using grunt, bower and less.
Once you have all dependencies installed, you just need to:
Open your terminal and clone the project.
$ git clone https://github.com/Marjoel/website-boilerplate
Then go to the project's folder.
$ cd website-boilerplate
Install local dependencies.
$ npm install
You should to put your Google Analytics ID in /project/assets/js/analytics.js
var gaId = 'UA-XXXXXXXX-X'; // change 'UA-XXXXXXXX-X' for your Google Analytics ID
You should to put your website name in /project/.htaccess
, change website
to your website
RewriteCond %{HTTP_HOST} ^website.com [NC]
RewriteRule ^(.*)$ http://www.website.com/$1 [r=301,NC]
Execute the command below to generate the website into /dist
directory and start the server (before the development).
$ npm start
Execute this to generate the website into /dist
directory (after the development).
$ grunt build
Then run on the browser.
http://localhost:8081
Grunt /tasks
:
grunt-contrib-clean
: delete the/dist
pathgrunt-contrib-copy
: copy the.html
,.htaccess
androbots.txt
to/dist
grunt-contrib-htmlmin
: minify the.html
filesgrunt-contrib-uglify
: minify combine and minify the.js
filesgrunt-contrib-imagemin
: minify the imagesgrunt-contrib-cssmin
: minify the.css
filegrunt-contrib-less
: css preprocessorgrunt-purifycss
: remove thecss code
that is not usinggrunt-csscomb
: combine the cssmedia queries
grunt-contrib-connect
: start the server onhttp://localhost:8081
grunt-contrib-watch
: watch for modifications on.css
,.js
and.html
grunt-concurrent
: start more than one watch per time
- When you use any js component on
bower
, add it on/task/uglify.js
- When you use any css component on
bower
, add it on/task/less.js
- When you use any css class that is added on html through js, add the
.js
file on/task/purifycss.js