tailwindcss/src/util/configurePlugins.js
Adam Wathan 65fde59f6a
Make it possible to enable caretColor and content core plugins in AOT mode (#4548)
* Fix issue where disabled corePlugins can't be re-enabled

* Disable caretColor and content core plugins by default, enable in JIT

* Don't disable caretColor/content in default config stub, hard-code for AOT instead

But with ability to still opt-in through your own config. Somewhat messy, but goal is to keep the messes in the AOT path and keep the JIT path pure.

* Fix style

* Revert unnecessary changes

* Fix style
2021-06-03 15:27:22 +02:00

23 lines
578 B
JavaScript

export default function (pluginConfig, plugins) {
if (pluginConfig === undefined) {
return plugins
}
const pluginNames = Array.isArray(pluginConfig)
? pluginConfig
: [
...new Set(
plugins
.filter((pluginName) => {
return pluginConfig !== false && pluginConfig[pluginName] !== false
})
.concat(
Object.keys(pluginConfig).filter((pluginName) => {
return pluginConfig[pluginName] !== false
})
)
),
]
return pluginNames
}