gulp-recipe-autoprefixer
Advanced tools
Comparing version 0.1.0 to 0.1.1
49
main.js
'use strict'; | ||
module.exports = function ($, config, sources) { | ||
var _ = $.lodash; | ||
/** | ||
* Css transforming with autoprefixer. | ||
* Connects to css transforming hooks. | ||
* Works well with recipes like [gulp-recipe-sass](https://github.com/PGS-dev/gulp-recipe-sass) or [gulp-recipe-css](https://github.com/PGS-dev/gulp-recipe-css). | ||
*/ | ||
module.exports = { | ||
configReader: function ($, config) { | ||
var _ = $.lodash; | ||
var defVersions = ['> 1%', 'last 2 versions', 'Firefox ESR', 'Opera 12.1', 'ie 9']; | ||
var conf = _.merge({ | ||
order: 100, | ||
dev: true, | ||
prod: true | ||
}, config.autoprefixer); | ||
conf.versions = conf.versions || defVersions; | ||
if(_.isUndefined(config.order.autoprefixer)) { | ||
config.order.autoprefixer = 100; | ||
} | ||
var pipeDef = [conf.order, $.lazypipe().pipe($.autoprefixer, conf.versions)]; | ||
return { | ||
pipes: { | ||
processCss: conf.prod ? pipeDef : undefined, | ||
devProcessCss: conf.dev ? pipeDef : undefined | ||
} | ||
}; | ||
var conf = _.merge({ | ||
dev: true, | ||
dist: true | ||
}, config.autoprefixer); | ||
conf.versions = conf.versions || ['> 1%', 'last 2 versions', 'Firefox ESR', 'Opera 12.1', 'ie 9']; | ||
config.autoprefixer = conf; | ||
return config; | ||
}, | ||
recipe: function ($, config) { | ||
var pipeDef = [config.order.autoprefixer, $.lazypipe().pipe($.autoprefixer, config.autoprefixer.versions)]; | ||
return { | ||
pipes: { | ||
/** | ||
* @hooks pipes.processCss* | ||
* @hooks pipes.devProcessCss* | ||
*/ | ||
processCss: config.autoprefixer.dist ? pipeDef : undefined, | ||
devProcessCss: config.autoprefixer.dev ? pipeDef : undefined | ||
} | ||
}; | ||
} | ||
}; |
{ | ||
"name": "gulp-recipe-autoprefixer", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": "Receipe for preprocessing css files with autoprefixer", | ||
@@ -5,0 +5,0 @@ "main": "main.js", |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
3222
4
33
1
50