gulp-inline-css
Advanced tools
Comparing version 1.0.0 to 1.0.1
15
index.js
'use strict'; | ||
var gutil = require('gulp-util'); | ||
var through = require('through2'); | ||
var juice = require('juice2'); | ||
var gutil = require('gulp-util'), | ||
through = require('through2'), | ||
juice = require('juice2'); | ||
module.exports = function(opt){ | ||
return through.obj(function (file, enc, cb) { | ||
opt = opt || {}; | ||
var _opt = JSON.parse(JSON.stringify(opt || {})); | ||
// 'url' option is required | ||
// set it automatically if not provided | ||
opt.url = opt.url || 'file://' + file.path; | ||
if (!_opt.url) { | ||
_opt.url = 'file://' + file.path; | ||
} | ||
@@ -19,3 +22,3 @@ if (file.isStream()) { | ||
juice.juiceContent(file.contents, opt, function(err, html) { | ||
juice.juiceContent(file.contents, _opt, function(err, html) { | ||
if (err) { | ||
@@ -22,0 +25,0 @@ this.emit('error', new gutil.PluginError('gulp-inline-css', err)); |
{ | ||
"name": "gulp-inline-css", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Inline linked css in an html file. Useful for emails.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
5815
26