Skip to content

Commit ba2ee13

Browse files
committedMay 16, 2017
1 parent 0efd1c3 commit ba2ee13

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed
 

‎index.js

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ module.exports = function gulpCleanCSS(options, callback) {
2626
if (file.sourceMap)
2727
options.sourceMap = JSON.parse(JSON.stringify(file.sourceMap));
2828

29+
if(!options.rebaseTo)
30+
options.rebase = false;
31+
2932
let style = {
3033
[file.path]: {
3134
styles: file.contents ? file.contents.toString() : ''

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "gulp-clean-css",
33
"description": "Minify css with clean-css.",
44
"homepage": "https://github.com/scniro/gulp-clean-css#readme",
5-
"version": "3.3.0",
5+
"version": "3.3.1",
66
"author": "scniro",
77
"license": "MIT",
88
"bugs": {

‎test/test.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -265,18 +265,17 @@ describe('gulp-clean-css: base functionality', function () {
265265
});
266266

267267
describe('gulp-clean-css: rebase', function () {
268-
269-
it('should not rebase files by default', function (done) {
268+
it('should not rebase files by default - do not resolve relative files', function (done) {
270269

271270
gulp.src(['test/fixtures/rebasing/subdir/insub.css'])
272271
.pipe(cleanCSS())
273272
.on('data', function (file) {
274273

275274
let expected = `
276-
p.insub_same{background:url(test/fixtures/rebasing/subdir/insub.png)}
277-
p.insub_child{background:url(test/fixtures/rebasing/subdir/child/child.png)}
278-
p.insub_parent{background:url(test/fixtures/rebasing/parent.png)}
279-
p.insub_other{background:url(test/fixtures/rebasing/othersub/inother.png)}
275+
p.insub_same{background:url(insub.png)}
276+
p.insub_child{background:url(child/child.png)}
277+
p.insub_parent{background:url(../parent.png)}
278+
p.insub_other{background:url(../othersub/inother.png)}
280279
p.insub_absolute{background:url(/inroot.png)}`;
281280

282281
let actual = file.contents.toString();

0 commit comments

Comments
 (0)
Please sign in to comment.