Commit dc0928d0 authored by Thomas Park's avatar Thomas Park

add autoprefixer

parent a240cb46
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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment