Created
May 25, 2014 08:56
-
-
Save baniol/36dcfb6e6f71478280bb to your computer and use it in GitHub Desktop.
grunt tasks from https://github.com/mmistakes/hpstr-jekyll-theme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
jshint: { | |
options: { | |
jshintrc: '.jshintrc' | |
}, | |
all: [ | |
'Gruntfile.js', | |
'assets/js/*.js', | |
'assets/js/plugins/*.js', | |
'!assets/js/scripts.min.js' | |
] | |
}, | |
recess: { | |
dist: { | |
options: { | |
compile: true, | |
compress: true | |
}, | |
files: { | |
'assets/css/main.min.css': [ | |
'assets/less/main.less' | |
] | |
} | |
}, | |
dev: { | |
options: { | |
compile: true, | |
compress: false | |
}, | |
files: { | |
'assets/css/main.css': [ | |
'assets/less/main.less' | |
] | |
} | |
} | |
}, | |
uglify: { | |
dist: { | |
files: { | |
'assets/js/scripts.min.js': [ | |
'assets/js/plugins/*.js', | |
'assets/js/_*.js' | |
] | |
} | |
} | |
}, | |
imagemin: { | |
dist: { | |
options: { | |
optimizationLevel: 7, | |
progressive: true | |
}, | |
files: [{ | |
expand: true, | |
cwd: 'images/', | |
src: '{,*/}*.{png,jpg,jpeg}', | |
dest: 'images/' | |
}] | |
} | |
}, | |
svgmin: { | |
dist: { | |
files: [{ | |
expand: true, | |
cwd: 'images/', | |
src: '{,*/}*.svg', | |
dest: 'images/' | |
}] | |
} | |
}, | |
watch: { | |
less: { | |
files: [ | |
'assets/less/*.less', | |
'assets/less/bootstrap/*.less' | |
], | |
tasks: ['recess'] | |
}, | |
js: { | |
files: [ | |
'<%= jshint.all %>' | |
], | |
tasks: ['jshint','uglify'] | |
} | |
}, | |
clean: { | |
dist: [ | |
'assets/css/main.min.css', | |
'assets/js/scripts.min.js' | |
] | |
} | |
}); | |
// Load tasks | |
grunt.loadNpmTasks('grunt-contrib-clean'); | |
grunt.loadNpmTasks('grunt-contrib-jshint'); | |
grunt.loadNpmTasks('grunt-contrib-uglify'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-recess'); | |
grunt.loadNpmTasks('grunt-contrib-imagemin'); | |
grunt.loadNpmTasks('grunt-svgmin'); | |
// Register tasks | |
grunt.registerTask('default', [ | |
'clean', | |
'recess', | |
'uglify', | |
'imagemin', | |
'svgmin' | |
]); | |
grunt.registerTask('dev', [ | |
'watch' | |
]); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment