Jakub Pawlowicz [Wed, 11 Jan 2017 07:40:03 +0000 (08:40 +0100)]
See #425 - nitpicking natural sorting algorithm.
Thanks to @alexlamsl for spotting these.
Jakub Pawlowicz [Tue, 10 Jan 2017 17:04:07 +0000 (18:04 +0100)]
Fixes #425 - enables natural method of sorting selectors.
Still defaults to standard sorting but natural becomes
a new option. Controlled via `selectorsSortingMethod`
option in level 1 optimizations.
Why:
* Natural way could be a more compression-efficient way;
* it's easier to read for a human.
Jakub Pawlowicz [Thu, 5 Jan 2017 11:35:17 +0000 (12:35 +0100)]
See #425 - adds natural sorting algorithm.
Why:
* We need it to sort selectors accordingly.
Jakub Pawlowicz [Wed, 11 Jan 2017 07:43:39 +0000 (08:43 +0100)]
Always run CI on Node.js 7 too.
At this moment it's a current version of Node.js so it'd be good
to run tests on it.
See: https://github.com/nodejs/LTS
Jakub Pawlowicz [Tue, 10 Jan 2017 13:39:51 +0000 (14:39 +0100)]
Fixes #853 - renames level 2 options.
Why:
* To match level 1 wording which feels more natural.
Jakub Pawlowicz [Tue, 10 Jan 2017 12:42:35 +0000 (13:42 +0100)]
Restores proper multiple level handling in CLI.
Why:
* Apparently the earlier change to a single dash option
broke using multiple optimization levels at once.
This commit restores it.
Jakub Pawlowicz [Tue, 10 Jan 2017 11:11:22 +0000 (12:11 +0100)]
Adds examples of `all` keyword in level 1/2 optimizations.
Why:
* So the option is documented properly.
Jakub Pawlowicz [Tue, 10 Jan 2017 11:05:27 +0000 (12:05 +0100)]
Allows `all` shortcut in level 1 optimizations config.
Why:
* To enable/disable all options at once;
* note non-boolean options are ignored when `all` / `*` is used.
Jakub Pawlowicz [Tue, 10 Jan 2017 10:09:48 +0000 (11:09 +0100)]
Inverts some level 1 options for consistency.
@alexlamsl made a good point that when we have `all` shortcut,
to set all options at once, it'd be good if value given would
mean the same to all options.
Jakub Pawlowicz [Mon, 9 Jan 2017 14:17:39 +0000 (15:17 +0100)]
Adds granular control over level 1 optimizations.
Why:
* So users can turn them on/off selectively;
* still keeping sane defaults for most users.
Note: moves `properties.fontWeight` compatibility flag to level 1
optimizations as that's not a compatibility flag, but rather a
user preference - see #756.
Jakub Pawlowicz [Mon, 9 Jan 2017 20:36:15 +0000 (21:36 +0100)]
Renames level 1 optimizations test file.
Jakub Pawlowicz [Mon, 9 Jan 2017 13:48:34 +0000 (14:48 +0100)]
Reorganizes level 1 optimizations.
Why:
* Slightly more coherent now, will get more love in 4.1.
Jakub Pawlowicz [Mon, 9 Jan 2017 12:52:43 +0000 (13:52 +0100)]
See #731 - adds granular control over level 2 optimizations.
Why:
* So users can selectively disable certain optimizations if they
want to.
Jakub Pawlowicz [Mon, 9 Jan 2017 10:52:12 +0000 (11:52 +0100)]
Runs benchmark on each optimization level.
Jakub Pawlowicz [Mon, 9 Jan 2017 09:44:51 +0000 (10:44 +0100)]
See #791 - normalizes stored paths.
Stores all paths internally as normalized to *nix format but
still outputs Windows friendly paths if needed.
`source-map` does it internally so there's no need to transform
paths in source maps.
Jakub Pawlowicz [Sun, 8 Jan 2017 17:04:18 +0000 (18:04 +0100)]
Reorganizes optimizer around levels.
Why:
* Gets rid of the flat structure where levels' code was mixed;
* moves level 2 compacting into a namespace (folderspace?).
Jakub Pawlowicz [Sun, 8 Jan 2017 11:09:50 +0000 (12:09 +0100)]
See #807 - disables restructuring optimizations.
Can be brought back with:
* `{ level: { 2: { restructuring: true } } }` in API;
* `-O2 restructuring:on` in CLI.
Why:
* Those can be slow on big files;
* Need further optimizations and code cleanup, see #533.
Alex Lam S.L [Sun, 8 Jan 2017 10:36:26 +0000 (11:36 +0100)]
See #842 - removes HTML comments from selectors.
Kudos to @alexlamsl for the fix.
Why:
* Apparently anything wrapped between HTML comments still gets
processed by browsers.
Jakub Pawlowicz [Sun, 8 Jan 2017 09:52:37 +0000 (10:52 +0100)]
See #850 - restores `-On` CLI option.
Thanks @alexlamsl for figuring it out!
Jakub Pawlowicz [Fri, 6 Jan 2017 13:26:12 +0000 (14:26 +0100)]
Fixes #717 - makes level 1 optimizations default.
Why:
* This way is safer for end user;
* Leaves level 2 optimizations up to end user to test and decide if
the end result is good enough.
Jakub Pawlowicz [Fri, 6 Jan 2017 12:56:24 +0000 (13:56 +0100)]
Fixes #836 - enables level `0` optimizations.
Why:
* Some people may need to bundle and rebase CSS without applying
any optimizations.
Jakub Pawlowicz [Fri, 6 Jan 2017 11:26:18 +0000 (12:26 +0100)]
See #850 - allows `on` or `off` as level option values.
Why:
* In CLI mode it makes more sense to use these instead of `true`
or `false` as in API (JavaScript) context.
Jakub Pawlowicz [Fri, 6 Jan 2017 11:18:47 +0000 (12:18 +0100)]
See #850 - cleans up optimization level code.
Why:
* For better readability.
Jakub Pawlowicz [Fri, 6 Jan 2017 10:56:57 +0000 (11:56 +0100)]
See #850 - allows overriding all options.
Why:
* Use `all` or `*` to reset all options to a given value.
Example:
```js
new CleanCSS({
level: {
2: {
all: false,
mediaMerging: true
}
}
});
```
Jakub Pawlowicz [Thu, 5 Jan 2017 22:14:26 +0000 (23:14 +0100)]
Fixes #850 - implements optimization levels.
Why:
* To logically split optimizations into three groups - level 0
(not implemented yet), level 1, and level 2 (default);
* To allow more fine-grained control over what's optimized on
each level (pending);
* To have a future-proof way of setting it for both API & CLI.
Jakub Pawlowicz [Thu, 5 Jan 2017 13:46:02 +0000 (14:46 +0100)]
Removes `benchmark` API option.
Why:
* total time is reported under `stats`;
* it was seriously impaired since optimizing got encapsulated
and not invoked directly from lib/clean.js.
Jakub Pawlowicz [Wed, 4 Jan 2017 21:22:05 +0000 (22:22 +0100)]
Fixed #828 - `-chrome-` hack support.
Why:
* It was incorrectly handled by property extractor.
Jakub Pawlowicz [Wed, 4 Jan 2017 20:24:26 +0000 (21:24 +0100)]
Fixes #460 - unescaped semicolon in selector.
Why:
* Such rules should be dropped. Warnings are already in place.
Jakub Pawlowicz [Wed, 4 Jan 2017 17:43:50 +0000 (18:43 +0100)]
Fixes #806 - skip optimizing variable properties.
Why:
* So far it's impossible to find out real property values so
breaking up shorthands into components doesn't work.
* In theory one could optimize cases where all component values
are given and one of them is a variable, but it's an additional
complexity probably not worth the hassle.
Jakub Pawlowicz [Wed, 4 Jan 2017 17:09:44 +0000 (18:09 +0100)]
See #796 - adds missing History.md entry.
Jakub Pawlowicz [Wed, 4 Jan 2017 17:06:29 +0000 (18:06 +0100)]
Reuses `rulesOverlap` helper.
Why:
* It's used in more than one place and the code was not reused.
Jakub Pawlowicz [Tue, 3 Jan 2017 16:37:56 +0000 (17:37 +0100)]
Fixes #796 - enables semantic merging for `@media` blocks.
* It's off by default and can be enabled via `semanticMerging` flag;
* Handles all cases and BEM classes.
Jakub Pawlowicz [Wed, 4 Jan 2017 15:23:05 +0000 (16:23 +0100)]
See #689 - fixes regression in parsing property blocks.
Why:
* New tokenizer introduced an issue where a semicolon ending a
property block was handled incorrectly.
Jakub Pawlowicz [Sun, 1 Jan 2017 11:45:33 +0000 (12:45 +0100)]
Fixes a bug ignoring incorrect properties in complex restructuring.
Why:
* Apparently there was a wrong value returned from sorting callback
which only manifested in complex stylesheets being restructured.
Jakub Pawlowicz [Sun, 1 Jan 2017 11:25:57 +0000 (12:25 +0100)]
See #290 - allows `font-weight` overriding.
Why:
* Another step to move away from aggressive merging.
Jakub Pawlowicz [Sun, 1 Jan 2017 11:19:47 +0000 (12:19 +0100)]
See #290 - allows `height` overriding.
Why:
* Another step to move away from aggressive merging.
Jakub Pawlowicz [Sat, 31 Dec 2016 18:02:31 +0000 (19:02 +0100)]
Fixes #750 - allows `width` overriding.
Why:
* Width can be overriden easily using `unit` overrider.
Jakub Pawlowicz [Sat, 31 Dec 2016 10:34:32 +0000 (11:34 +0100)]
See #829 - another performance optimization.
Why:
* Well, if a selector doesn't have a colon there is no point
looking for any pseudo classes/elements.
Jakub Pawlowicz [Fri, 30 Dec 2016 21:55:20 +0000 (22:55 +0100)]
See #829 - fixes a typo in method name.
Jakub Pawlowicz [Fri, 30 Dec 2016 21:50:09 +0000 (22:50 +0100)]
See #829 - some performance tweaks.
Why:
* Uses flat loops instead of callbacks;
* Checks for number of matches before invoking costly calculations.
Jakub Pawlowicz [Fri, 30 Dec 2016 21:23:29 +0000 (22:23 +0100)]
Fixes #829 - adds more strict selector merging rules.
Why:
* Instead of blacklisting unmergeable selectors we're now
whitelisting the valid ones and reject all other.
Jakub Pawlowicz [Fri, 30 Dec 2016 11:49:02 +0000 (12:49 +0100)]
Fixes #739 - error when a closing brace is missing.
Why:
* When such content gets parsed into a block we should ignore
the whole declaration as browsers do.
Jakub Pawlowicz [Fri, 30 Dec 2016 10:47:05 +0000 (11:47 +0100)]
See #703 - adds `ie11` alias to default compatibility.
Jakub Pawlowicz [Fri, 30 Dec 2016 06:40:08 +0000 (07:40 +0100)]
See #703 - re-enables `background` longhand merging.
Why:
* See #577 and #579 - these two clearly state the issue is about
IE8 not IE9+, and according to tests and caniuse.com tables
using `background-(clip|origin|size)` in `background` shorthand
is supported on IE9+;
* At this point I have no idea why it was disabled at the time.
One idea is that it was disabled because IE9 doesn't support
`properties.spaceAfterClosingBrace` and these two issues
overlappedi at the time of 3.2 branch. (both were "fixed" in 3.3);
* Let's enable it again, since the default mode is now IE10+.
** Important note **: Safari <7 and Android stock browser <4.4
does not support it either so you'll likely have to disable if
you still support those. Just use `--compatibility ie8` to do so.
Test case: https://jsfiddle.net/7zLwv7o0/5/
Jakub Pawlowicz [Thu, 29 Dec 2016 11:32:52 +0000 (12:32 +0100)]
See #703 - adds `ie10` alias to default compatibility.
Jakub Pawlowicz [Tue, 27 Dec 2016 20:15:10 +0000 (21:15 +0100)]
See #703 - changes default compatibility to IE10+.
Why:
* It's high time to move it up as IE9 is relatively old now.
* Adds `ie9` compatibility mode to make it easy to go back
to 3.x default.
Jakub Pawlowicz [Tue, 27 Dec 2016 15:51:40 +0000 (16:51 +0100)]
Simplifies compatibility mode definitions.
Why:
* Using inheritance it's clear which properties change.
Jakub Pawlowicz [Tue, 27 Dec 2016 14:12:28 +0000 (15:12 +0100)]
Fixes #785 - adds `@font-face` de-duplication.
Why:
* Extra `@font-face` rules can be safely removed.
* There's no API/CLI switch to turn it off as it's pending
a refactoring in v4 - see #842.
Jakub Pawlowicz [Tue, 27 Dec 2016 13:39:15 +0000 (14:39 +0100)]
See #801 - adds History.md entry.
Jakub Pawlowicz [Tue, 27 Dec 2016 13:31:10 +0000 (14:31 +0100)]
See #801 - recommends clean-css styles concatenation.
Why:
* There is a difference between passing in a concatenated string
and letting clean-css do the job. The former will discard
`@import` statements appearing not at the beginning of the string,
while the latter will discard only those appearing not at
the beginning of any of the files. Because of this behavior,
the latter way is recommended.
Jakub Pawlowicz [Tue, 27 Dec 2016 13:10:08 +0000 (14:10 +0100)]
See #801 - adds test cases to avoid regression.
Why:
* It works as expected since
426127a, but there were no
explicit tests for this feature.
Jakub Pawlowicz [Mon, 26 Dec 2016 15:30:35 +0000 (16:30 +0100)]
Fixes #849 - disables inlining protocol-less resources.
Why:
* It's not safe to assume a HTTP protocol;
* It's better to leave such resources to be resolved at runtime
when stylesheets are interpreted inside a HTTP(S) context.
Jakub Pawlowicz [Mon, 26 Dec 2016 15:03:11 +0000 (16:03 +0100)]
Splits `inliner` option in two.
* `{ inliner: { request: ... } }` becomes `{ inlineRequest: ... }`;
* `{ inliner: { timeout: N } }` becomes `{ inlineTimeout: N }`;
* `--timeout` becomes `--inline-timeout`.
Why:
* To relate it directly to the new `inline` option.
* Also `--timeout` option relates to `@import` inlining only
so it should not be "global".
Jakub Pawlowicz [Mon, 26 Dec 2016 14:26:09 +0000 (15:26 +0100)]
Fixes #767 - refactors inlining options.
Merges `processImport` and `processImportFrom` API options into
a single `inline` option. It accepts the same set of rules as
`processImportFrom` previously, e.g.
`{ inline: 'none' }`
`{ inline: ['local', '127.0.0.1] }`
Also the `inline` option defaults to `local` now, which means
remote `@import` rules are **NOT** inlined by default anymore.
To re-enable it use any of the following:
`{ inline: 'all' }`
`{ inline: 'local,remote' }`
Why:
* These two options were meant to be merged as they represent the
same concept;
* Inlining remote `@import` rules by default may not be desirable;
* "Inline" as the option name better represents what this option
does, as it also applies to source maps.
Jakub Pawlowicz [Mon, 26 Dec 2016 11:42:08 +0000 (12:42 +0100)]
Reworks inlining so resources are loaded lazily.
Why:
* when using a hash as an input, the sources it references
should be processed lazily instead of a whole hash being
serialized & tokenized eagerly.
This change addresses the need by:
* See #791 - in-memory imports require such lazy processing.
The other way, we end up with duplicated rules, and have to rely
on advanced processing to remove them.
Jakub Pawlowicz [Sun, 25 Dec 2016 14:38:04 +0000 (15:38 +0100)]
Fixes #791 - resolves imports in-memory if possible.
Why:
* When a hash is given as a source, some imports can be inlined
in-memory taking styles from the hash.
Jakub Pawlowicz [Fri, 23 Dec 2016 22:00:46 +0000 (23:00 +0100)]
See #710 - adds a test case to prevent regressions.
Jakub Pawlowicz [Fri, 23 Dec 2016 21:00:43 +0000 (22:00 +0100)]
See #808 - adds a test case to prevent regressions.
Jakub Pawlowicz [Fri, 23 Dec 2016 20:43:50 +0000 (21:43 +0100)]
Fixes #845 - fixes web compatibility in 4.0.
Why:
* 4.0 calculates stats by default but `process.hrtime` is not
available inside browsers. However, since we don't need
sub-ms resolution, `Date.now()` can be used instead.
Jakub Pawlowicz [Fri, 23 Dec 2016 19:54:45 +0000 (20:54 +0100)]
Fixes #685 - adds lowercase hex color normalization.
Why:
* This change does not affect color interpretation.
* Allow potential merging improvements as colors are normalized.
Jakub Pawlowicz [Fri, 23 Dec 2016 17:24:56 +0000 (18:24 +0100)]
See #560 - adds a test case to prevent future regressions.
Jakub Pawlowicz [Fri, 23 Dec 2016 17:05:17 +0000 (18:05 +0100)]
Fixes #847 - ignores selectors with invalid characters.
Why:
* Browsers won't apply such rules so neither should we.
Jakub Pawlowicz [Thu, 22 Dec 2016 21:18:33 +0000 (22:18 +0100)]
Fixes #758 - ignores rules with empty selectors.
Jakub Pawlowicz [Thu, 22 Dec 2016 20:51:11 +0000 (21:51 +0100)]
Fixes #817 - makes `off` disable rounding.
Why:
* `-1` is still an alias to `off`.
* It won't be used that often as rounding is now disabled
by default.
Jakub Pawlowicz [Thu, 22 Dec 2016 15:13:03 +0000 (16:13 +0100)]
See #209 - adds missing readme for `beautify` option.
Jakub Pawlowicz [Thu, 22 Dec 2016 14:41:58 +0000 (15:41 +0100)]
Fixes #209 - adds output formatting via `beautify` option.
Why:
* So clean-css can be used to format CSS nicely as well.
Jakub Pawlowicz [Thu, 22 Dec 2016 07:59:41 +0000 (08:59 +0100)]
Fixes tokenizer edge case.
If there is a semicolon marker after a property then the property
ends and its reference should be discarded. Otherwise next tokens
may get appended to the property.
Jakub Pawlowicz [Wed, 21 Dec 2016 11:05:46 +0000 (12:05 +0100)]
Fixed #432 - adds URLs normalization.
Why:
* So further merging or compacting can happen more effectively
even when initial URL formatting is different.
Jakub Pawlowicz [Wed, 21 Dec 2016 10:46:14 +0000 (11:46 +0100)]
Fixes #756 - adds disabling font-weight optimizations.
Why:
* Some users reported a need to keep original values;
* Actually we want all optimizations to be configurable.
Jakub Pawlowicz [Wed, 21 Dec 2016 07:37:58 +0000 (08:37 +0100)]
See #657 - adds missing History.md entry.
Jakub Pawlowicz [Tue, 20 Dec 2016 14:47:53 +0000 (15:47 +0100)]
Fixes #686 - adds rounding precision for all units.
** BREAKING CHANGE ** - setting a rounding precision value to a
number applies it to *all* units now, not `px` only.
Why:
* To give users more control over how units are optimized.
Jakub Pawlowicz [Tue, 20 Dec 2016 16:10:47 +0000 (17:10 +0100)]
Fixes #657 - adds property name validation.
It's a bit relaxed matching but too strict one would do too much
harm with many false-positives.
Why:
* To prevent processing errors further down the optimization pipeline.
Jakub Pawlowicz [Tue, 20 Dec 2016 15:22:44 +0000 (16:22 +0100)]
Standardizes <file>:<line>:<column> formatting.
Why:
* When a warning is raised we should give user as much info as
possible, which includes a filename, line and column number.
Jakub Pawlowicz [Mon, 19 Dec 2016 09:26:45 +0000 (10:26 +0100)]
Fixes #818 - disables `px` rounding by default.
Why:
* It is a safer default than `2` which may lead to some
issues with Bootstrap and other CSS frameworks depending
on a high-precision `px` values.
Also see #686 which will make rounding more flexible and
available to all units.
Jakub Pawlowicz [Mon, 19 Dec 2016 09:58:25 +0000 (10:58 +0100)]
Refactors batch-test.js.
Why:
* Wasn't too DRY anymore.
Jakub Pawlowicz [Mon, 19 Dec 2016 09:49:00 +0000 (10:49 +0100)]
Fixes #704 - adds batch CLI tests.
Why:
* To compare output generated by CLI and API (should be the same!).
Jakub Pawlowicz [Mon, 19 Dec 2016 07:16:47 +0000 (08:16 +0100)]
Adds link to official web interface to readme.
Jakub Pawlowicz [Mon, 19 Dec 2016 07:11:29 +0000 (08:11 +0100)]
Adds Readme section on 4.0 breaking changes.
Jakub Pawlowicz [Mon, 19 Dec 2016 06:53:29 +0000 (07:53 +0100)]
See #789 - adds a test case to avoid future regressions.
Jakub Pawlowicz [Mon, 19 Dec 2016 06:43:07 +0000 (07:43 +0100)]
See #809 - adds a test case to avoid future regressions.
Jakub Pawlowicz [Mon, 19 Dec 2016 06:39:24 +0000 (07:39 +0100)]
See #786 - adds a test case to avoid future regressions.
Jakub Pawlowicz [Sun, 18 Dec 2016 15:46:28 +0000 (16:46 +0100)]
Fixes #834 - adds extra line break in nested blocks.
Why:
* It's slightly easier to read when preserving line breaks.
Jakub Pawlowicz [Sun, 18 Dec 2016 11:24:53 +0000 (12:24 +0100)]
Fixes #839 - allows URIs in import inlining rules.
Why:
* To give more control over which resource can and cannot be
inlined.
Jakub Pawlowicz [Sun, 18 Dec 2016 10:02:05 +0000 (11:02 +0100)]
Bumps nock dev dependency to 9.x.
Jakub Pawlowicz [Sat, 17 Dec 2016 17:04:17 +0000 (18:04 +0100)]
Bumps online version to clean-css 3.4.23.
Jakub Pawlowicz [Sat, 17 Dec 2016 16:53:12 +0000 (17:53 +0100)]
Version 3.4.23 release notes.
Jakub Pawlowicz [Sat, 17 Dec 2016 16:46:06 +0000 (17:46 +0100)]
See #844 - fixes matching whitespace in property extraction.
On 3.4 branch it was completely broken whereas on master it had
problems with tab separated values while others were good.
Jakub Pawlowicz [Sat, 17 Dec 2016 12:14:16 +0000 (13:14 +0100)]
Fixes #840 - allows input source map as map object.
Why:
* It's been always odd that we required a serialized JSON when
user may already had it parsed.
Jakub Pawlowicz [Sat, 17 Dec 2016 11:54:27 +0000 (12:54 +0100)]
Fixes #843 - more restrictive quote removal rules.
Why:
* Only remove quotes from selector argument values if allowed.
Jakub Pawlowicz [Sat, 17 Dec 2016 11:15:53 +0000 (12:15 +0100)]
See #843 - fixes an edge case in attribute tidying.
Why:
* We should treat single and double quotes properly as in tokenizer.
Jakub Pawlowicz [Sat, 17 Dec 2016 10:23:38 +0000 (11:23 +0100)]
Fixes 4.0.0-pre Windows tests.
Why:
* This is because of line breaks difference between platforms.
Jakub Pawlowicz [Fri, 16 Dec 2016 10:18:32 +0000 (11:18 +0100)]
Refactors rebasing code.
Why:
* By using the same wording / variable names it is now easier to
understand how rebasing words.
* It's remarkable in how few places we need to rebase paths now. :)
Jakub Pawlowicz [Thu, 15 Dec 2016 20:12:49 +0000 (21:12 +0100)]
Bumps version to 4.0.0-pre.
API and CLI compatibility has been broken thus the major version
needs to move up.
Jakub Pawlowicz [Thu, 15 Dec 2016 16:20:01 +0000 (17:20 +0100)]
Moves all writing-related code to `writer` folder.
Why:
* To make it clearer what it does.
Jakub Pawlowicz [Thu, 15 Dec 2016 16:05:04 +0000 (17:05 +0100)]
Moves all reading-related modules to `reader` folder.
Why:
* Grouping it together for clarity sake.
Jakub Pawlowicz [Wed, 14 Dec 2016 16:19:56 +0000 (17:19 +0100)]
Exposes inlined stylesheet URIs.
Why:
* So the list can be printed in debug mode.
Jakub Pawlowicz [Sun, 11 Dec 2016 10:50:11 +0000 (11:50 +0100)]
Restores source map support.
Re-built from ground up on top of the new tokenizing process
it features simpler rebasing while still supporting all features
of the previous solution.
Jakub Pawlowicz [Sun, 11 Dec 2016 10:26:39 +0000 (11:26 +0100)]
Standardizes parsed tokens.
This commit unifies tokenized values' structure, i.e.
```
[
<TOKEN_NAME>,
<TOKEN_VALUE>,
<METADATA>
]
```
Why:
* So it's easier to work with those values further down the
optimizing pipeline and when restoring back to text content.
Jakub Pawlowicz [Thu, 8 Dec 2016 07:04:31 +0000 (08:04 +0100)]
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.
Jakub Pawlowicz [Wed, 7 Dec 2016 12:19:11 +0000 (13:19 +0100)]
Restores accepting `Buffer` as input.