Merge pull request #849 from tailwindcss/disable-all-core-plugins
Support disabling all corePlugins with corePlugins: false
This commit is contained in:
commit
43f63bf2e5
2 changed files with 13 additions and 1 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue