Skip to content

Commit

Permalink
Add autoprefixer to the build chain.
Browse files Browse the repository at this point in the history
  • Loading branch information
lrsjng committed Mar 29, 2015
1 parent 65ca06e commit d4a72b1
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions mkrfile.js
Expand Up @@ -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');
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -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",
Expand Down

0 comments on commit d4a72b1

Please sign in to comment.