Simplifies URL rebasing.
authorJakub Pawlowicz <contact@jakubpawlowicz.com>
Thu, 8 Dec 2016 07:04:31 +0000 (08:04 +0100)
committerJakub Pawlowicz <contact@jakubpawlowicz.com>
Fri, 16 Dec 2016 10:49:34 +0000 (11:49 +0100)
commitda45a94c9f62a957c5a9baf940ba2299967b8632
tree622b5a75acdd4765ba3b5bc1860ec866919f87aa
parent35649486658de33a1e24f0d66aad8072bd1af654
Simplifies URL rebasing.

** WARNING ** - this is a truly breaking change.

There is now a single option called `rebaseTo`, which denotes a
path all relative URLs are rebased to.

Absolute URLs are kept intact as it's assumed user knows what
he/she does when using them, however absolute @imports are still
inlined relative to the current working directory.

This commit also re-introduces ability to pass arrays to CleanCSS
`minify` method.

** IMPORTANT ** - it'd probably be wise to give users an option
to use a function as `rebaseTo` so they can restore some of old
functionality if needed.

Why:

* The old system with three options (`relativeTo`, `root`, and
  `target`) was too hard to understand and work with reliably.
26 files changed:
History.md
README.md
bin/cleancss
lib/clean.js
lib/optimizer/basic.js
lib/urls/rebase-config.js [deleted file]
lib/urls/rewrite.js [moved from lib/urls/rewrite-url.js with 98% similarity]
lib/utils/read-sources.js
test/batch-test.js
test/bench.js
test/binary-test.js
test/fixtures/blueprint-min.css
test/fixtures/bootstrap-min.css
test/fixtures/font-awesome-min.css
test/fixtures/issue-198-min.css
test/fixtures/issue-232-min.css
test/fixtures/issue-304-2-min.css
test/fixtures/issue-304-min.css
test/fixtures/issue-312-min.css
test/fixtures/issue-466-min.css
test/fixtures/issue-490-min.css
test/fixtures/issue-543-min.css
test/fixtures/line-breaks-in-attributes-min.css
test/fixtures/partials-absolute/extra/sub.css
test/integration-test.js
test/module-test.js