1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
diff --git a/src/class-names/index.js b/src/class-names/index.js
index c18c93a6e32089c2d2a7dbf8d28ac6b9c93a4e36..2aaec68aa35f27c932ca91020de137f49919ecce 100644
--- a/src/class-names/index.js
+++ b/src/class-names/index.js
@@ -43,6 +43,7 @@ async function run() {
let configPath
let postcss
let tailwindcss
+ let browserslist
let version
configPath = await globSingle(CONFIG_GLOB, {
@@ -57,6 +58,11 @@ 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']
@@ -103,11 +109,12 @@ separator: typeof userSeperator === 'undefined' ? ':' : userSeperator,
classNames: await extractClassNames(ast),
dependencies: hook.deps,
plugins: getPlugins(config),
- variants: getVariants({ config, version, postcss }),
+ variants: getVariants({ config, version, postcss, browserslist }),
utilityConfigMap: await getUtilityConfigMap({
cwd: configDir,
resolvedConfig,
postcss,
+ browserslist,
}),
}
}
|