* 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
23 lines
578 B
JavaScript
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
|
|
}
|