We have a rule cache that we reuse — in contrast to normal tailwind which generates fresh rules every run. This is fine when rules are treated as immutable objects. However, aditional postcss plugins may not honor this contract.
For example, if you use css-loader and have url rewriting turned on (and it is by default) then css-loader will mutate the rules it gets from postcss-loader as it has the ability to use the postcss AST directly. This saves on memory but in our case causes an issue because these rule objects point directly to our cache.
Here we combat this by cloning the rules that go directly into the root node.
Closes #134
We have a rule cache that we reuse — in contrast to normal tailwind which generates fresh rules every run. This is fine when rules are treated as immutable objects. However, aditional postcss plugins may not honor this contract.
For example, if you use css-loader and have url rewriting turned on (and it is by default) then css-loader will mutate the rules it gets from postcss-loader as it has the ability to use the postcss AST directly. This saves on memory but in our case causes an issue because these rule objects point directly to our cache.
Here we combat this by cloning the rules that go directly into the root node.