diff options
author | Thomas Park <thomas@thomaspark.me> | 2014-11-13 03:58:57 -0500 |
---|---|---|
committer | Thomas Park <thomas@thomaspark.me> | 2014-11-13 03:58:57 -0500 |
commit | dc0928d084dce2a2def47a2c4f42af7b19f7e2b9 (patch) | |
tree | 528b3472f0ef9b10f6469e85196779539fced0ce | |
parent | a240cb46dbc25e584ece827d8e7b4980c93957e0 (diff) |
add autoprefixer
-rw-r--r-- | Gruntfile.js | 18 | ||||
-rw-r--r-- | package.json | 1 |
2 files changed, 18 insertions, 1 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index c40b869c..954a1746 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,10 +1,13 @@ module.exports = function (grunt) { + grunt.loadNpmTasks('grunt-autoprefixer'); grunt.loadNpmTasks('grunt-contrib-less'); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.loadNpmTasks('grunt-contrib-connect'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-watch'); + var configBridge = grunt.file.readJSON('./bower_components/bootstrap/grunt/configBridge.json', { encoding: 'utf8' }); + // Project configuration. grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), @@ -46,6 +49,14 @@ module.exports = function (grunt) { files: {} } }, + autoprefixer: { + options: { + browsers: configBridge.config.autoprefixerBrowsers + }, + dist: { + src: ['*/bootstrap.css', '*/bootstra.min.css'] + } + }, watch: { files: ['*/variables.less', '*/bootswatch.less', '*/index.html'], tasks: 'build', @@ -103,10 +114,15 @@ module.exports = function (grunt) { grunt.config('less.dist.files', files); grunt.config('less.dist.options.compress', false); - grunt.task.run(['concat', 'less:dist', 'clean:build', + grunt.task.run(['concat', 'less:dist', 'prefix:' + lessDest, 'clean:build', compress ? 'compress:'+lessDest+':'+'<%=builddir%>/' + theme + '/bootstrap.min.css':'none']); }); + grunt.registerTask('prefix', 'autoprefix a generic css', function(fileSrc) { + grunt.config('autoprefixer.dist.src', fileSrc); + grunt.task.run('autoprefixer'); + }); + grunt.registerTask('compress', 'compress a generic css', function(fileSrc, fileDst) { var files = {}; files[fileDst] = fileSrc; grunt.log.writeln('compressing file ' + fileSrc); diff --git a/package.json b/package.json index 1ccd7e8d..eb92095c 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "devDependencies": { "bower": "~1.2.8", "grunt": "~0.4.2", + "grunt-autoprefixer": "~1.0.1", "grunt-contrib-clean": "~0.5.0", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-connect": "~0.8.0", |