Created
October 30, 2013 06:31
-
-
Save samuelhorn/7228011 to your computer and use it in GitHub Desktop.
My personal gruntfile
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
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
sass: { | |
dev: { | |
options: { | |
style: 'expanded' | |
}, | |
src: ['scss/style.scss'], | |
dest: 'style.css' | |
}, | |
prod: { | |
options: { | |
style: 'compressed' | |
}, | |
src: ['scss/style.scss'], | |
dest: 'style.css' | |
} | |
}, | |
htmlmin: { | |
prod: { | |
options: { | |
removeComments: true, | |
collapseWhitespace: true, | |
removeEmptyAttributes: true, | |
removeCommentsFromCDATA: true, | |
removeRedundantAttributes: true, | |
collapseBooleanAttributes: true | |
}, | |
files: { | |
'./index-min.html': './index.html' | |
} | |
} | |
}, | |
watch: { | |
css: { | |
files: ['**/*.scss'], | |
tasks: ['development'], | |
options: { | |
livereload: true | |
}, | |
}, | |
} | |
}); | |
// Load NPM's via matchdep | |
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
// Development task | |
grunt.registerTask('development', ['sass:dev']); | |
// Distrubution Task | |
grunt.registerTask('production', ['sass:prod', 'htmlmin:prod']); | |
} |
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
{ | |
"name": "grunttest", | |
"version": "0.0.1", | |
"devDependencies": { | |
"grunt": "~0.4.1", | |
"grunt-contrib-watch": "~0.4.3", | |
"grunt-contrib-uglify": "~0.2.5", | |
"grunt-contrib-sass": "~0.5.0", | |
"matchdep": "~0.1.2", | |
"grunt-contrib-htmlmin": "~0.1.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment