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-boilerplateThen go to the project's folder.
$ cd website-boilerplateInstall local dependencies.
$ npm installYou 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 IDYou 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 startExecute this to generate the website into /dist directory (after the development).
$ grunt buildThen run on the browser.
http://localhost:8081
Grunt /tasks:
grunt-contrib-clean: delete the/distpathgrunt-contrib-copy: copy the.html,.htaccessandrobots.txtto/distgrunt-contrib-htmlmin: minify the.htmlfilesgrunt-contrib-uglify: minify combine and minify the.jsfilesgrunt-contrib-imagemin: minify the imagesgrunt-contrib-cssmin: minify the.cssfilegrunt-contrib-less: css preprocessorgrunt-purifycss: remove thecss codethat is not usinggrunt-csscomb: combine the cssmedia queriesgrunt-contrib-connect: start the server onhttp://localhost:8081grunt-contrib-watch: watch for modifications on.css,.jsand.htmlgrunt-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
.jsfile on/task/purifycss.js