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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
diff --git a/src/server.ts b/src/server.ts
index 0a928f527f0cadbe8419bef46fd8e648818a989e..6f6e317c70a8a7e62409a8cb12c222afd3bbc61c 100644
--- a/src/server.ts
+++ b/src/server.ts
@@ -445,6 +445,11 @@ module: __non_webpack_require__(
resolveFrom(configDir, 'tailwindcss/lib/jit/lib/setupContext')
).default,
},
+ expandApplyAtRules: {
+ module: __non_webpack_require__(
+ resolveFrom(configDir, 'tailwindcss/lib/jit/lib/expandApplyAtRules')
+ ).default,
+ },
}
} catch (_) {
try {
@@ -457,6 +462,11 @@ },
setupContext: {
module: __non_webpack_require__(
resolveFrom(configDir, 'tailwindcss/jit/lib/setupContext')
+ ),
+ },
+ expandApplyAtRules: {
+ module: __non_webpack_require__(
+ resolveFrom(configDir, 'tailwindcss/jit/lib/expandApplyAtRules')
),
},
}
@@ -491,6 +501,10 @@
if (applyComplexClasses && !applyComplexClasses.default.__patched) {
let _applyComplexClasses = applyComplexClasses.default
applyComplexClasses.default = (config, ...args) => {
+ if (state.jit) {
+ return state.modules.jit.expandApplyAtRules.module(state.jitContext)
+ }
+
let configClone = klona(config)
configClone.separator = typeof state.separator === 'undefined' ? ':' : state.separator
@@ -629,6 +643,15 @@ hook.unhook()
throw error
}
+ if (state.jit) {
+ state.jitContext = state.modules.jit.setupContext.module(state.configPath)(
+ { opts: {}, messages: [] },
+ state.modules.postcss.module.root()
+ )
+ state.jitContext.tailwindConfig.separator =
+ typeof userSeperator === 'undefined' ? ':' : userSeperator
+ }
+
let postcssResult: Result
try {
postcssResult = await postcss
@@ -689,13 +712,6 @@ state.config = resolveConfig.module(config)
state.separator = typeof userSeperator === 'string' ? userSeperator : ':'
state.plugins = await getPlugins(config)
state.classNames = (await extractClassNames(postcssResult.root)) as ClassNames
-
- if (state.jit) {
- state.jitContext = state.modules.jit.setupContext.module(state.configPath)(
- { opts: {}, messages: [] },
- state.modules.postcss.module.root()
- )
- }
state.variants = getVariants(state)
|