diff --git a/build/gulp/style-compiler.js b/build/gulp/style-compiler.js index 1bff0fae2d60..58f35970659c 100644 --- a/build/gulp/style-compiler.js +++ b/build/gulp/style-compiler.js @@ -1,24 +1,45 @@ var gulp = require('gulp'); var path = require('path'); var context = require('./context.js'); +var autoPrefix = require('gulp-autoprefixer'); function runStyleCompiler(command, params, callback) { - var spawn = require('child_process').spawn; - var process = spawn( - 'dotnet', - ['build/style-compiler/bin/style-compiler.dll', command].concat(params), - { stdio: 'inherit' } - ); + var spawn = require('child_process').spawn, + process = spawn( + 'dotnet', + ['build/style-compiler/bin/style-compiler.dll', command].concat(params), + { stdio: 'inherit' } + ); process.on('exit', function(code) { if(code === 0) { - callback(); + addCssPrefixes(params, callback); } else { callback('Style compiler failed'); } }); } +function addCssPrefixes(params, callback) { + var outputPath; + + if(params.length > 0) { + outputPath = params.find(param => !!param.match("--output-path")); + outputPath = outputPath && outputPath.replace("--output-path=", ""); + } + if(outputPath) { + gulp.src(outputPath + "/*.css") + .pipe(autoPrefix()) + .pipe(gulp.dest(function(file) { + return file.base; + }).on('end', function() { + callback(); + })).on('error', function() { + callback(' Autoprefixer failed'); + }); + } +} + function generateCustomTheme(baseTheme, baseColorScheme, baseSizeScheme, customMetaPath, outputPath, callback) { var params = [ '--base-theme=' + baseTheme, diff --git a/package.json b/package.json index ce23ae6aaf22..dd19dfc47fb1 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,7 @@ "gulp-typescript": "^3.0.2", "gulp-uglify": "^1.5.3", "gulp-watch": "^5.0.0", + "gulp-autoprefixer": "^5.0.0", "handlebars": "4.0.11", "hogan.js": "3.0.2", "jquery": "3.1.1", @@ -104,5 +105,11 @@ "dev": "gulp dev", "test-env": "node testing/launch" }, + "browserslist": [ + "last 1 version", + "ios > 6", + "ie > 10", + "> 1%" + ], "pre-commit": "lint-staged" }