Skip to content

Instantly share code, notes, and snippets.

@jessekinsman
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jessekinsman/26fe14b4c56fc6278a22 to your computer and use it in GitHub Desktop.
Save jessekinsman/26fe14b4c56fc6278a22 to your computer and use it in GitHub Desktop.
Grunt configuration for using autoprefixer with Zurb Foundation
// 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