Add autoprefixer to the build chain.

This commit is contained in:
Lars Jung 2015-03-29 01:59:39 +01:00
parent 65ca06e7ea
commit d4a72b1b11
2 changed files with 26 additions and 0 deletions

View File

@ -29,6 +29,29 @@ function getBuildSuffix(callback) {
}
$.fn.autoprefixer = function (options) {
var autoprefixer = require('autoprefixer-core');
var options = {browsers: ['last 2 version']};
return this.edit(function (blob) {
try {
blob.content = autoprefixer.process(blob.content, options).css;
} catch (e) {
fQuery.report({
type: 'err',
method: 'autoprefixer',
message: e.message,
fquery: this,
blob: blob,
err: e
});
}
});
};
$.plugin('fquery-cssmin');
$.plugin('fquery-handlebars');
$.plugin('fquery-includeit');
@ -109,6 +132,7 @@ module.exports = function (suite) {
$(src + ': _h5ai/client/css/*.less')
.newerThan(mapSrc, $(src + ': _h5ai/client/css/**'))
.less()
.autoprefixer()
.cssmin()
.wrap(header)
.write(mapSrc, true);
@ -148,6 +172,7 @@ module.exports = function (suite) {
$(src + ': _h5ai/client/css/*.less')
.newerThan(mapSrc, $(src + ': _h5ai/client/css/**'))
.less()
.autoprefixer()
// .cssmin()
.wrap(header)
.write(mapSrc, true);

View File

@ -16,6 +16,7 @@
"test": "mocha --recursive test"
},
"devDependencies": {
"autoprefixer-core": "~5.1.8",
"fquery": "~0.16.2",
"fquery-cssmin": "~0.3.0",
"fquery-handlebars": "~0.2.0",