gulp-minify-css
Advanced tools
Comparing version 0.3.1 to 0.3.2
13
index.js
@@ -5,3 +5,4 @@ var es = require('event-stream'), | ||
BufferStreams = require('bufferstreams'), | ||
gutil = require('gulp-util'); | ||
gutil = require('gulp-util'), | ||
path = require('path'); | ||
@@ -41,3 +42,13 @@ // File level transform function | ||
// Image URLs are rebased with the assumption that they are relative to the | ||
// CSS file they appear in (unless "relativeTo" option is explicitly set by | ||
// caller) | ||
var relativeToTmp = opt.relativeTo; | ||
opt.relativeTo = relativeToTmp || path.resolve(path.dirname(file.path)); | ||
var newContents = new CleanCSS(opt).minify(String(newFile.contents)); | ||
// Restore original "relativeTo" value | ||
opt.relativeTo = relativeToTmp; | ||
newFile.contents = new Buffer(newContents); | ||
@@ -44,0 +55,0 @@ cb(null, newFile); |
{ | ||
"name": "gulp-minify-css", | ||
"description": "Minify css with clean-css.", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"repository": "https://github.com/jonathanepollack/gulp-minify-css.git", | ||
@@ -6,0 +6,0 @@ "homepage": "https://github.com/jonathanepollack/gulp-minify-css", |
@@ -27,8 +27,8 @@ [![Build Status](https://travis-ci.org/jonathanepollack/gulp-minify-css.png?branch=master)](https://travis-ci.org/jonathanepollack/gulp-minify-css) | ||
```js | ||
var minifyCSS = require('gulp-minify-css'); | ||
var gulp = require('gulp'), | ||
minifyCSS = require('gulp-minify-css'); | ||
gulp.task('minify-css', function() { | ||
gulp.src('./static/css/*.css') | ||
.pipe(minifyCSS(opts)) | ||
.pipe(minifyCSS({keepBreaks:true})) | ||
.pipe(gulp.dest('./dist/')) | ||
@@ -35,0 +35,0 @@ }); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9636
182