Skip to content

Instantly share code, notes, and snippets.

@cr0ybot
Forked from jshawl/Gruntfile.js
Last active August 29, 2015 14:23
Show Gist options
  • Save cr0ybot/14505111a279f48fd750 to your computer and use it in GitHub Desktop.
Save cr0ybot/14505111a279f48fd750 to your computer and use it in GitHub Desktop.
module.exports = function(grunt) {
require('load-grunt-tasks')(grunt);
require('grunt-postcss')(grunt);
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
options: {
sourceMap: false
},
dev: {
options:{
outputStyle:'expanded'
},
files: {
// Must specify each individual CSS file here
'css/styles.css' : 'scss/styles.scss'
}
},
dist: {
options:{
outputStyle:'compressed'
},
files: {
// Must specify each individual CSS file here
'css/styles.css' : 'scss/styles.scss'
}
}
},
postcss:{
options:{
remove: false,
map: false,
processors: [
require('autoprefixer-core')({
browsers: ['last 2 versions']
})
]
},
dist:{
src: 'css/*.css'
}
},
watch: {
options: {
// Switch to true if using livereload
livereload: false
},
css: {
files: 'scss/**/*.scss',
tasks: ['sass:dev', 'postcss:dist']
}
}
});
grunt.registerTask('default',['watch']);
grunt.registerTask('build',['sass:dist','postcss:dist']);
}
{
"name": "NAME",
"version": "1.0.0",
"devDependencies": {
"autoprefixer-core": "^5.2.0",
"grunt": "^0.4.5",
"grunt-contrib-watch": "^0.6.1",
"grunt-postcss": "^0.5.1",
"grunt-sass": "^1.0.0",
"load-grunt-tasks": "^3.2.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment