Skip to content

Instantly share code, notes, and snippets.

@pepelsbey
Created December 28, 2013 11:34
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pepelsbey/8158495 to your computer and use it in GitHub Desktop.
Save pepelsbey/8158495 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
grunt.initConfig({
sass: {
compile: {
options: {
style: 'compressed'
},
files: {
'styles/screen.css': 'styles/screen.scss'
}
}
},
autoprefixer: {
prefix: {
src: 'styles/screen.css'
}
},
csso: {
minify: {
files: {
'styles/screen.css' : 'styles/screen.css'
}
}
},
jekyll: {
build: {}
},
htmlmin: {
site: {
options: {
removeComments: true,
collapseWhitespace: true
},
expand: true,
cwd: '_site/',
src: '**/*.html',
dest: '_site/'
}
},
imagemin: {
site: {
expand: true,
cwd: '_site/',
src: '**/*.{png,jpg,gif}',
dest: '_site/'
}
},
watch: {
styles: {
files: 'styles/*.scss',
tasks: ['sass', 'autoprefixer', 'jekyll']
},
jekyll: {
files: [
'**',
'!_site/**',
'!node_modules/**',
'!.sass-cache/**',
'!Gruntfile.js',
'!package.json',
'!.git/**'
],
tasks: 'jekyll'
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-autoprefixer');
grunt.loadNpmTasks('grunt-csso');
grunt.loadNpmTasks('grunt-jekyll');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-htmlmin');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.registerTask('default', [
'sass',
'autoprefixer',
'csso',
'jekyll',
'htmlmin',
'imagemin'
]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment