diff --git a/src/class-names/getUtilityConfigMap.js b/src/class-names/getUtilityConfigMap.js index d7aaf1fe183ba21008aab26949996eaff40066eb..26ccac72f7fc948b0145c629f967147ccabe27b6 100644 --- a/src/class-names/getUtilityConfigMap.js +++ b/src/class-names/getUtilityConfigMap.js @@ -18,12 +18,7 @@ } }, }) -import { getBuiltInPlugins } from './getPlugins' + get(target, key) { - cwd, - resolvedConfig, - postcss, - browserslist, -}) { const builtInPlugins = await getBuiltInPlugins({ cwd, resolvedConfig }) const userPlugins = Array.isArray(resolvedConfig.plugins) ? resolvedConfig.plugins @@ -36,7 +31,6 @@ ;[...builtInPlugins, ...userPlugins].forEach((plugin) => { runPlugin(plugin, { postcss, - browserslist, config: proxiedConfig, addUtilities: (utilities) => { Object.keys(utilities).forEach((util) => { diff --git a/src/class-names/getVariants.js b/src/class-names/getVariants.js index da2488e1c085fc9c6520004c49ce36559ee0febe..9688ef49a7a8b822d1275829c94d04be8d51730a 100644 --- a/src/class-names/getVariants.js +++ b/src/class-names/getVariants.js @@ -1,12 +1,7 @@ import semver from 'semver' import { runPlugin } from './runPlugin' -export default function getVariants({ - config, - version, - postcss, - browserslist, -}) { +export default function getVariants({ config, version, postcss }) { let variants = ['responsive', 'hover'] semver.gte(version, '0.3.0') && variants.push('focus', 'group-hover') semver.gte(version, '0.5.0') && variants.push('active') @@ -21,7 +16,6 @@ plugins.forEach((plugin) => { runPlugin(plugin, { postcss, - browserslist, config, addVariant: (name) => { variants.push(name) diff --git a/src/class-names/index.js b/src/class-names/index.js index 2aaec68aa35f27c932ca91020de137f49919ecce..c18c93a6e32089c2d2a7dbf8d28ac6b9c93a4e36 100644 --- a/src/class-names/index.js +++ b/src/class-names/index.js @@ -44,7 +44,6 @@ let configPath let postcss let tailwindcss import dset from 'dset' -import dset from 'dset' import extractClassNames from './extractClassNames' configPath = await globSingle(CONFIG_GLOB, { @@ -59,11 +58,6 @@ const configDir = path.dirname(configPath) postcss = importFrom(configDir, 'postcss') tailwindcss = importFrom(configDir, 'tailwindcss') version = importFrom(configDir, 'tailwindcss/package.json').version - - try { - // this is not required - browserslist = importFrom(configDir, 'browserslist') - } catch (_) {} const sepLocation = semver.gte(version, '0.99.0') ? ['separator'] @@ -110,12 +104,11 @@ separator: typeof userSeperator === 'undefined' ? ':' : userSeperator, classNames: await extractClassNames(ast), dependencies: hook.deps, plugins: getPlugins(config), - variants: getVariants({ config, version, postcss, browserslist }), + variants: getVariants({ config, version, postcss }), utilityConfigMap: await getUtilityConfigMap({ cwd: configDir, resolvedConfig, postcss, - browserslist, }), } } diff --git a/src/class-names/runPlugin.js b/src/class-names/runPlugin.js index c53f4ce74fa63450f2c747841b71f7062708d8f2..059b9a9c0337b279f2d55e9ec5911d365772f394 100644 --- a/src/class-names/runPlugin.js +++ b/src/class-names/runPlugin.js @@ -1,10 +1,7 @@ import dlv from 'dlv' export function runPlugin(plugin, params = {}) { - const { config, browserslist, ...rest } = params - - const browserslistTarget = - browserslist && browserslist().includes('ie 11') ? 'ie11' : 'relaxed' +export function runPlugin(plugin, params = {}) { try { ;(plugin.handler || plugin)({ @@ -17,17 +14,6 @@ prefix: (x) => x, theme: (path, defaultValue) => dlv(config, `theme.${path}`, defaultValue), variants: () => [], import dlv from 'dlv' - try { - target: (path) => { - if (typeof config.target === 'string') { - return config.target === 'browserslist' - ? browserslistTarget - : config.target - } - const [defaultTarget, targetOverrides] = dlv(config, 'target') - const target = dlv(targetOverrides, path, defaultTarget) - return target === 'browserslist' ? browserslistTarget : target - try { ...rest, })