Last active
August 29, 2015 14:14
-
-
Save jessekinsman/26fe14b4c56fc6278a22 to your computer and use it in GitHub Desktop.
Grunt configuration for using autoprefixer with Zurb Foundation
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
// After some debugging, got this working. Didn't see it documented anywhere so thought I would put this up to help any others | |
// First install the grunt-postcss and autoprefixer-core npm repositiories | |
// Looks like this: npm install grunt-postcss autoprefixer-core | |
var autoprefixer = require('autoprefixer-core'); | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
sass: { | |
options: { | |
includePaths: ['bower_components/foundation/scss'] | |
}, | |
dist: { | |
options: { | |
outputStyle: 'compressed' | |
}, | |
files: { | |
'css/app.css': 'scss/app.scss' | |
} | |
} | |
}, | |
postcss: { | |
options: { | |
processors: [ | |
autoprefixer({ browsers: ['last 2 version'] }).postcss | |
] | |
}, | |
dist: { src: 'css/app.css'} | |
}, | |
watch: { | |
grunt: { files: ['Gruntfile.js'] }, | |
postcss: { | |
files: 'css/app.css', | |
tasks: 'postcss', | |
options: { | |
nospawn: true | |
} | |
}, | |
sass: { | |
files: 'scss/**/*.scss', | |
tasks: ['sass'] | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-sass'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
grunt.loadNpmTasks('grunt-postcss'); | |
grunt.registerTask('build', ['sass']); | |
grunt.registerTask('default', ['build','watch']); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment