Created
December 5, 2013 11:48
-
-
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.
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: { | |
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); | |
}; |
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": "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