UNPKG

lixin-web

Version:

vue and bootstrap

17 lines (16 loc) 502 B
const Datauri = require('datauri'); const through = require('through2'); module.exports = function(...className) { let count = 0 return through.obj(function(file, encoding, callback) { file.contents = new Buffer(new Datauri(file.base + '' + file.relative).getCSS({ class: className[count++], width: true, height: true })) //to write .css file file.path = file.path.replace('png','css') this.push(file) callback() }); };