gulp-bless
Advanced tools
Comparing version 1.0.1 to 1.0.2
var gulp = require('gulp'); | ||
var mocha = require('gulp-mocha'); | ||
var coverage = require('gulp-coverage'); | ||
var through2 = require('through2'); | ||
@@ -17,2 +16,7 @@ gulp.task('default', ['test']); | ||
})) | ||
/* | ||
// uncomment and comment out other coverage.* pipes to get coverage HTML report | ||
.pipe(coverage.report({ | ||
outFile: 'coverage.html' | ||
}))*/ | ||
.pipe(coverage.gather()) | ||
@@ -19,0 +23,0 @@ .pipe(coverage.enforce({ |
33
index.js
'use strict'; | ||
var through = require('through'); | ||
var os = require('os'); | ||
var through = require('through2'); | ||
var path = require('path'); | ||
@@ -16,8 +15,9 @@ var bless = require('bless'); | ||
function bufferContents(file, encoding, cb){ | ||
if (file.isNull()) return; // ignore | ||
if (file.isStream()) return this.emit('error', new PluginError(pluginName, 'Streaming not supported')); | ||
return through.obj(function(file, enc, cb) { | ||
if (file.isNull()) return cb(null, file); // ignore | ||
if (file.isStream()) return cb(new PluginError(pluginName, 'Streaming not supported')); | ||
var stream = this; | ||
if(file.contents){ | ||
if (file.contents && file.contents.toString()) { | ||
var fileName = path.basename(file.path); | ||
@@ -30,5 +30,5 @@ var outputFilePath = path.resolve(path.dirname(file.path), fileName); | ||
options: options | ||
}).parse(contents, function (err, blessedFiles, numSelectors) { | ||
}).parse(contents, function(err, blessedFiles, numSelectors) { | ||
if (err) { | ||
throw new PluginError(pluginName, err); | ||
return cb(new PluginError(pluginName, err)); | ||
} | ||
@@ -47,3 +47,3 @@ | ||
blessedFiles.forEach(function (blessedFile) { | ||
stream.emit('data', new File({ | ||
stream.push(new File({ | ||
cwd: file.cwd, | ||
@@ -55,14 +55,9 @@ base: file.base, | ||
}); | ||
cb(); | ||
}); | ||
} else { | ||
return cb(null, file); | ||
} | ||
else { | ||
cb(file, null); | ||
} | ||
} | ||
function endStream(){ | ||
this.emit('end'); | ||
} | ||
return through(bufferContents, endStream); | ||
}); | ||
}; |
{ | ||
"name": "gulp-bless", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"homepage": "http://github.com/adam-lynch/gulp-bless", | ||
@@ -8,5 +8,5 @@ "description": "CSS post-processor which splits CSS files suitably for Internet Explorer < 10. Bless + Gulp = gulp-bless.", | ||
"dependencies": { | ||
"bless": "*", | ||
"bless": "~3.0.3", | ||
"gulp-util": "*", | ||
"through": "~2.3.4" | ||
"through2": "~0.5.1" | ||
}, | ||
@@ -17,4 +17,3 @@ "devDependencies": { | ||
"gulp-mocha": "*", | ||
"should": "*", | ||
"through2": "~0.4.1" | ||
"should": "*" | ||
}, | ||
@@ -21,0 +20,0 @@ "scripts": { |
gulp-bless [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][depstat-image]][depstat-url] | ||
========== | ||
CSS post-processor which splits CSS files suitably for Internet Explorer < 10. | ||
Gulp plugin which splits CSS files suitably for Internet Explorer < 10. | ||
@@ -61,2 +61,7 @@ This is the a [Gulp](http://github.com/gulpjs/gulp) wrapper around [bless.js](https://github.com/paulyoung/bless.js) (see [blesscss.com](http://blesscss.com/)). | ||
##### A note about sourcemaps: | ||
If you're using a CSS pre-processor which creates inline sourcemaps [bless.js](https://github.com/paulyoung/bless.js) will take a very long time to run. It's recommended that you don't pass files containing inline sourcemaps to `gulp-bless`. If you do want to use sourcemaps then create them as a separate `.map` file. | ||
If you can't create separate sourcemap files — such as if you are using ~v0.7 of [gulp-sass](https://www.npmjs.org/package/gulp-sass) which uses `libsass` — consider creating a minified version of your CSS (using something like [gulp-minify-css](https://www.npmjs.org/package/gulp-minify-css)) which strips out the inline sourcemap and running `gulp-bless` on that, then include that file in production whilst still including your development version with its inline sourcemap when developing locally. | ||
## Warning: gulp-bless has changed a lot since 1.0.0 | ||
@@ -75,2 +80,2 @@ - It no longer concatenates all files that come down the pipeline. | ||
[depstat-url]: https://david-dm.org/adam-lynch/gulp-bless | ||
[depstat-image]: https://david-dm.org/adam-lynch/gulp-bless.png | ||
[depstat-image]: https://david-dm.org/adam-lynch/gulp-bless.png |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Floating dependency
QualityPackage has a dependency with a floating version range. This can cause issues if the dependency publishes a new major version.
Found 1 instance in 1 package
8090
4
1
80
72
+ Addedthrough2@~0.5.1
+ Addedbless@3.0.3(transitive)
+ Addedreadable-stream@1.0.34(transitive)
+ Addedthrough2@0.5.1(transitive)
+ Addedxtend@3.0.0(transitive)
- Removedthrough@~2.3.4
- Removedansi-regex@5.0.1(transitive)
- Removedany-promise@1.3.0(transitive)
- Removedatob@2.1.2(transitive)
- Removedbabel-runtime@6.26.0(transitive)
- Removedbalanced-match@1.0.2(transitive)
- Removedbless@4.0.4(transitive)
- Removedbrace-expansion@1.1.11(transitive)
- Removedcamelcase@2.1.1(transitive)
- Removedcliui@3.2.0(transitive)
- Removedcode-point-at@1.1.0(transitive)
- Removedcolumnify@1.6.0(transitive)
- Removedconcat-map@0.0.1(transitive)
- Removedcore-js@2.6.12(transitive)
- Removedcss@2.2.4(transitive)
- Removeddecamelize@1.2.0(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefaults@1.0.4(transitive)
- Removedformat-number@2.0.2(transitive)
- Removedfs-extra@0.26.7(transitive)
- Removedfs-promise@0.5.0(transitive)
- Removedfs.realpath@1.0.0(transitive)
- Removedglob@7.2.3(transitive)
- Removedgraceful-fs@4.2.11(transitive)
- Removedinflight@1.0.6(transitive)
- Removedinvert-kv@1.0.0(transitive)
- Removedis-fullwidth-code-point@1.0.0(transitive)
- Removedjsonfile@2.4.0(transitive)
- Removedklaw@1.3.1(transitive)
- Removedlcid@1.0.0(transitive)
- Removedlodash@4.17.21(transitive)
- Removedminimatch@3.1.2(transitive)
- Removedmz@2.7.0(transitive)
- Removednumber-is-nan@1.0.1(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedonce@1.4.0(transitive)
- Removedos-locale@1.4.0(transitive)
- Removedpath-is-absolute@1.0.1(transitive)
- Removedregenerator-runtime@0.11.1(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedrimraf@2.7.1(transitive)
- Removedrx@4.1.0(transitive)
- Removedsource-map@0.6.1(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedstring-width@1.0.2(transitive)
- Removedstrip-ansi@6.0.1(transitive)
- Removedthenify@3.3.1(transitive)
- Removedthenify-all@1.6.0(transitive)
- Removedthrough@2.3.8(transitive)
- Removedurix@0.1.0(transitive)
- Removedwcwidth@1.0.1(transitive)
- Removedwindow-size@0.1.4(transitive)
- Removedwrap-ansi@2.1.0(transitive)
- Removedwrappy@1.0.2(transitive)
- Removedy18n@3.2.2(transitive)
- Removedyargs@3.32.0(transitive)
Updatedbless@~3.0.3