+1.1.1 / 2013-xx-xx
+==================
+
+* Fixed issue [#144](https://github.com/GoalSmashers/clean-css/issues/144) - skip URLs rebasing by default.
+
1.1.0 / 2013-09-06
==================
fromBase: options.relativeTo
};
+ if (!rebaseOpts.absolute && !rebaseOpts.relative)
+ return data;
+
if (rebaseOpts.absolute)
rebaseOpts.toBase = path.resolve(options.root);
if (rebaseOpts.relative)
rebaseOpts.toBase = path.resolve(path.dirname(options.target));
+ if (!rebaseOpts.fromBase || !rebaseOpts.toBase)
+ return data;
+
return UrlRewriter.process(data, rebaseOpts);
}
};
if (specialUrl)
return url;
- if (!options.absolute && !options.relative)
- throw new Error('Relative url found: \'' + url + '\' but there is no way to resolve it (hint: use `root` or `output` options)');
-
- if (!options.fromBase || !options.toBase)
- return url;
-
if (options.absolute) {
rebased = path
.resolve(path.join(options.fromBase, url))
}),
'relative image paths': {
'no root & output': binaryContext('./test/data/partials-relative/base.css', {
- 'should raise error': function(error, stdout) {
- assert.equal(stdout, '');
- assert.notEqual(error, null);
+ 'should leave paths': function(error, stdout) {
+ assert.equal(stdout, 'a{background:url(../partials/extra/down.gif) 0 0 no-repeat}');
}
}),
'root but no output': binaryContext('-r ./test ./test/data/partials-relative/base.css', {
]
}),
'urls rewriting - no root or target': cssContext({
- 'no @import': [
- 'a{background:url(test/data/partials/extra/down.gif) 0 0 no-repeat}',
- null
- ],
+ 'no @import': 'a{background:url(test/data/partials/extra/down.gif) 0 0 no-repeat}',
'relative @import': [
'@import url(test/data/partials-relative/base.css);',
- null
+ 'a{background:url(test/data/partials/extra/down.gif) 0 0 no-repeat}'
],
'absolute @import': [
'@import url(/test/data/partials-relative/base.css);',
- null
+ 'a{background:url(test/data/partials/extra/down.gif) 0 0 no-repeat}'
]
}),
'urls rewriting - root but no target': cssContext({