Skip to content

Instantly share code, notes, and snippets.

View brunogarcia's full-sized avatar
📚
Always learning

Bruno brunogarcia

📚
Always learning
View GitHub Profile
/*
Cache breaker
Simple cache-breaker, appends a timestamp or md5 hash to any urls
https://www.npmjs.com/package/grunt-cache-breaker
*/
'cachebreaker': {
dev: {
options: {
match: ['main.min.js', 'main.css'],
},
/*
Sass
Compile Sass to CSS
https://www.npmjs.com/package/grunt-contrib-sass
*/
'sass': {
dist: {
options: {
style: 'compressed'
},
/*
HTML Min
Minify HTML
https://github.com/gruntjs/grunt-contrib-htmlmin
*/
'htmlmin': {
dist: {
options: {
removeComments: true,
collapseWhitespace: true
/*
Process HTML
Process html files at build time to modify them depending on the release environment
https://www.npmjs.com/package/grunt-processhtml
*/
'processhtml': {
dist: {
files: {
'<%= config.tmp %>/index.html': ['<%= config.dev %>/index.html']
}
/*
Uglify
Minify files with UglifyJS
https://github.com/gruntjs/grunt-contrib-uglify
*/
'uglify': {
my_target: {
files: {
'<%= config.dist %>/assets/js/main.min.js':
[
/*
Copy
Copy files and folders.
https://github.com/gruntjs/grunt-contrib-copy
*/
'copy': {
main: {
files: [
{
'expand': true,
/*
Clean
Clear files and folders
https://github.com/gruntjs/grunt-contrib-clean
*/
'clean': ['<%= config.dist %>', '<%= config.tmp %>'],
/*
JSHint
Validate files with JSHint
https://github.com/gruntjs/grunt-contrib-jshint
*/
'jshint': {
options: {
jshintrc: true
},
all: ['Gruntfile.js', '<%= config.dev %>/assets/js/main.js']
/*
Sass
Compile Sass to CSS
https://www.npmjs.com/package/grunt-contrib-sass
*/
'sass': {
dev: {
options: {
style: 'expanded'
},
/*
Watch
Run tasks whenever watched files change
https://www.npmjs.com/package/grunt-contrib-watch
*/
'watch': {
css: {
files: '<%= config.dev %>/assets/scss/*.scss',
tasks: ['sass:dev']
},