Repository: tailwindlabs/tailwindcss (TypeScript)
Task: Feature (2019-04-17 12:17:23+00:00)

Issue:
Ability to disable all core plugins (corePlugins: false?)
As discussed on Discord, it would be useful to be able to disable all core plugins without explicitly listing them all, for instance when using Tailwind in a test suite for a plugin. Adam suggested `corePlugins: false`.


Discussion:
Looking for this as well! I use Tailwind to generate mini util files for use in Shadow DOM. 

How can we provide a whitelist of plugins instead?

Patch:
diff --git a/src/util/configurePlugins.js b/src/util/configurePlugins.js
--- a/src/util/configurePlugins.js
+++ b/src/util/configurePlugins.js
@@ -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]()


Test patch:
diff --git a/__tests__/configurePlugins.test.js b/__tests__/configurePlugins.test.js
--- a/__tests__/configurePlugins.test.js
+++ b/__tests__/configurePlugins.test.js
@@ -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([])
+})