mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Merge pull request #849 from tailwindcss/disable-all-core-plugins
Support disabling all corePlugins with corePlugins: false
This commit is contained in:
commit
43f63bf2e5
@ -16,3 +16,15 @@ test('setting a plugin to false removes it', () => {
|
||||
|
||||
expect(configuredPlugins).toEqual(['fontSize', 'backgroundPosition'])
|
||||
})
|
||||
|
||||
test('passing only false removes all plugins', () => {
|
||||
const plugins = {
|
||||
fontSize: () => 'fontSize',
|
||||
display: () => 'display',
|
||||
backgroundPosition: () => 'backgroundPosition',
|
||||
}
|
||||
|
||||
const configuredPlugins = configurePlugins(false, plugins)
|
||||
|
||||
expect(configuredPlugins).toEqual([])
|
||||
})
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
export default function(pluginConfig, plugins) {
|
||||
return Object.keys(plugins)
|
||||
.filter(pluginName => {
|
||||
return pluginConfig[pluginName] !== false
|
||||
return pluginConfig !== false && pluginConfig[pluginName] !== false
|
||||
})
|
||||
.map(pluginName => {
|
||||
return plugins[pluginName]()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user