mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-08-05 21:07:26 +02:00
Add autoprefixer to the build chain.
This commit is contained in:
25
mkrfile.js
25
mkrfile.js
@@ -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-cssmin');
|
||||||
$.plugin('fquery-handlebars');
|
$.plugin('fquery-handlebars');
|
||||||
$.plugin('fquery-includeit');
|
$.plugin('fquery-includeit');
|
||||||
@@ -109,6 +132,7 @@ module.exports = function (suite) {
|
|||||||
$(src + ': _h5ai/client/css/*.less')
|
$(src + ': _h5ai/client/css/*.less')
|
||||||
.newerThan(mapSrc, $(src + ': _h5ai/client/css/**'))
|
.newerThan(mapSrc, $(src + ': _h5ai/client/css/**'))
|
||||||
.less()
|
.less()
|
||||||
|
.autoprefixer()
|
||||||
.cssmin()
|
.cssmin()
|
||||||
.wrap(header)
|
.wrap(header)
|
||||||
.write(mapSrc, true);
|
.write(mapSrc, true);
|
||||||
@@ -148,6 +172,7 @@ module.exports = function (suite) {
|
|||||||
$(src + ': _h5ai/client/css/*.less')
|
$(src + ': _h5ai/client/css/*.less')
|
||||||
.newerThan(mapSrc, $(src + ': _h5ai/client/css/**'))
|
.newerThan(mapSrc, $(src + ': _h5ai/client/css/**'))
|
||||||
.less()
|
.less()
|
||||||
|
.autoprefixer()
|
||||||
// .cssmin()
|
// .cssmin()
|
||||||
.wrap(header)
|
.wrap(header)
|
||||||
.write(mapSrc, true);
|
.write(mapSrc, true);
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
"test": "mocha --recursive test"
|
"test": "mocha --recursive test"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"autoprefixer-core": "~5.1.8",
|
||||||
"fquery": "~0.16.2",
|
"fquery": "~0.16.2",
|
||||||
"fquery-cssmin": "~0.3.0",
|
"fquery-cssmin": "~0.3.0",
|
||||||
"fquery-handlebars": "~0.2.0",
|
"fquery-handlebars": "~0.2.0",
|
||||||
|
Reference in New Issue
Block a user