bail out of the applyComplexClasses when it is not needed
There is no need in re-compiling tailwind or building expensive lookupt tables when it turns out that we don't even need it. We have a small overhead by walking the tree to check if `@apply` exists. However this outweighs the slowness of re-generating tailwind + expensive lookup tables.
This commit is contained in:
parent
4b15b90f21
commit
8c7fb84e58
1 changed files with 5 additions and 0 deletions
|
|
@ -236,6 +236,11 @@ function processApplyAtRules(css, lookupTree, config) {
|
|||
|
||||
export default function applyComplexClasses(config, getProcessedPlugins) {
|
||||
return function(css) {
|
||||
// We can stop already when we don't have any @apply rules. Vue users: you're welcome!
|
||||
if (!hasAtRule(css, 'apply')) {
|
||||
return css
|
||||
}
|
||||
|
||||
// Tree already contains @tailwind rules, don't prepend default Tailwind tree
|
||||
if (hasAtRule(css, 'tailwind')) {
|
||||
return processApplyAtRules(css, css, config)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue