Skip to content

Commit

Permalink
#42
Browse files Browse the repository at this point in the history
  • Loading branch information
scniro committed May 16, 2017
1 parent 0efd1c3 commit ba2ee13
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ module.exports = function gulpCleanCSS(options, callback) {
if (file.sourceMap)
options.sourceMap = JSON.parse(JSON.stringify(file.sourceMap));

if(!options.rebaseTo)
options.rebase = false;

let style = {
[file.path]: {
styles: file.contents ? file.contents.toString() : ''
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "gulp-clean-css",
"description": "Minify css with clean-css.",
"homepage": "https://github.com/scniro/gulp-clean-css#readme",
"version": "3.3.0",
"version": "3.3.1",
"author": "scniro",
"license": "MIT",
"bugs": {
Expand Down
11 changes: 5 additions & 6 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,18 +265,17 @@ describe('gulp-clean-css: base functionality', function () {
});

describe('gulp-clean-css: rebase', function () {

it('should not rebase files by default', function (done) {
it('should not rebase files by default - do not resolve relative files', function (done) {

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

let expected = `
p.insub_same{background:url(test/fixtures/rebasing/subdir/insub.png)}
p.insub_child{background:url(test/fixtures/rebasing/subdir/child/child.png)}
p.insub_parent{background:url(test/fixtures/rebasing/parent.png)}
p.insub_other{background:url(test/fixtures/rebasing/othersub/inother.png)}
p.insub_same{background:url(insub.png)}
p.insub_child{background:url(child/child.png)}
p.insub_parent{background:url(../parent.png)}
p.insub_other{background:url(../othersub/inother.png)}
p.insub_absolute{background:url(/inroot.png)}`;

let actual = file.contents.toString();
Expand Down

0 comments on commit ba2ee13

Please sign in to comment.