Last active
August 29, 2015 14:28
-
-
Save ahmadawais/260721bbd3e1d5167127 to your computer and use it in GitHub Desktop.
Grunt VS Gulp: Less compile and autoprefix
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.initConfig({ | |
less: { | |
development: { | |
files: { | |
"build/tmp/app.css": "assets/app.less" | |
} | |
} | |
}, | |
autoprefixer: { | |
options: { | |
browsers: ['last 2 version', 'ie 8', 'ie 9'] | |
}, | |
multiple_files: { | |
expand: true, | |
flatten: true, | |
src: 'build/tmp/app.css', | |
dest: 'build/' | |
} | |
} | |
}); | |
grunt.loadNpmTasks('grunt-contrib-less'); | |
grunt.loadNpmTasks('grunt-autoprefixer'); | |
grunt.registerTask('css', ['less', 'autoprefixer']); |
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
var gulp = require('gulp'), | |
less = require('gulp-less'), | |
autoprefix = require('gulp-autoprefixer'); | |
gulp.task('css', function () { | |
gulp.src('assets/app.less') | |
.pipe(less()) | |
.pipe(autoprefix('last 2 version', 'ie 8', 'ie 9')) | |
.pipe(gulp.dest('build')); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment