mirror of
https://github.com/lrsjng/h5ai.git
synced 2025-05-24 20:14:37 -04:00
Add autoprefixer to the build chain.
This commit is contained in:
parent
65ca06e7ea
commit
d4a72b1b11
2 changed files with 26 additions and 0 deletions
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",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue