Skip to content

Instantly share code, notes, and snippets.

@lunelson
Created December 5, 2013 11:48
Show Gist options
  • Save lunelson/7804039 to your computer and use it in GitHub Desktop.
Save lunelson/7804039 to your computer and use it in GitHub Desktop.
Example package.json and Gruntfile.js files demonstrating installation of @lydell's fork and branch of grunt-autorefixer with support for Sass' sourcemaps.
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
sass: {
build: {
files: {
'style.css': 'style.scss'
},
options: {
sourcemap: true,
style: 'expanded'
}
}
},
autoprefixer: {
options: {
// note the addition of this option over original grunt-autoprefixer
sourcemap: true
},
build: {
files: {
'style.css' : 'style.css'
},
},
},
watch: {
sass_watch: {
files: ['*.scss'],
tasks: ['css_build']
},
css_watch: {
files: ['*.css'],
options: {
livereload: true,
},
},
},
});
grunt.registerTask('default', ['watch'] );
grunt.registerTask('css_build', ['sass:build', 'autoprefixer:build']);
require("matchdep").filterDev("grunt-*").forEach(grunt.loadNpmTasks);
};
{
"name": "my-project",
"title": "My Project",
"version": "0.0.1",
"author": "My Name",
"private": true,
"devDependencies": {
"grunt": "~0.4.1",
"matchdep": "*",
"grunt-contrib-sass": "*",
"grunt-contrib-watch": "*",
"grunt-autoprefixer": "git+https://github.com/lydell/grunt-autoprefixer.git#source-maps"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment