From bdfe43a6392c0176d6b387dc26229ac86f4a55e5 Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Thu, 11 Jun 2020 12:10:47 +0100 Subject: [PATCH] provide corePlugins helper when running plugins --- src/class-names/runPlugin.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/class-names/runPlugin.js b/src/class-names/runPlugin.js index dbdd2b5..118961e 100644 --- a/src/class-names/runPlugin.js +++ b/src/class-names/runPlugin.js @@ -17,6 +17,12 @@ export function runPlugin(plugin, params = {}) { theme: (path, defaultValue) => dlv(config, `theme.${path}`, defaultValue), variants: () => [], config: (path, defaultValue) => dlv(config, path, defaultValue), + corePlugins: (path) => { + if (Array.isArray(config.corePlugins)) { + return config.corePlugins.includes(path) + } + return dlv(config, `corePlugins.${path}`, true) + }, target: (path) => { if (typeof config.target === 'string') { return config.target === 'browserslist'