Last active
August 29, 2015 14:07
-
-
Save bsima/a30dd43ccc5ffed7922a to your computer and use it in GitHub Desktop.
Grunt task(s) for compiling SASS and autoprefixing
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
/** | |
* Grunt task(s) for compiling SASS and autoprefixing | |
* | |
* To use: | |
* | |
* npm install grunt --save-dev | |
* npm install grunt-contrib-sass --save-dev | |
* npm install grunt-autoprefixer --save-dev | |
* npm install grunt-contrib-watch --save-dev | |
* curl --output Gruntfile.js https://gist.github.com/bsima/a30dd43ccc5ffed7922a/download | |
* grunt watch | |
*/ | |
module.exports = function(grunt) { | |
grunt.initConfig({ | |
sass: { | |
dist: { | |
files: { | |
'sass.css': 'main.scss', | |
} | |
} | |
}, | |
autoprefixer: { | |
dist: { | |
files: { | |
'main.css': 'sass.css' | |
} | |
} | |
}, | |
watch: { | |
styles: { | |
files: ['main.scss'], | |
tasks: ['sass','autoprefixer'] | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-sass'); | |
grunt.loadNpmTasks('grunt-autoprefixer'); | |
grunt.loadNpmTasks('grunt-contrib-watch'); | |
// Notify when a watched file is modified | |
grunt.event.on('watch', function(action, filepath, target) { | |
grunt.log.writeln(target + ': ' + filepath + ' has ' + action); | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment