File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed
packages/tailwindcss-language-service/src/util Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export interface State {
76
76
postcss ?: { version : string ; module : Postcss }
77
77
postcssSelectorParser ?: { module : any }
78
78
resolveConfig ?: { module : any }
79
- jit ?: { generateRules : { module : any } }
79
+ jit ?: { generateRules : { module : any } ; setupContext : { module : any } }
80
80
}
81
81
browserslist ?: string [ ]
82
82
featureFlags ?: FeatureFlags
Original file line number Diff line number Diff line change @@ -438,6 +438,11 @@ async function createProjectService(
438
438
resolveFrom ( configDir , 'tailwindcss/lib/jit/lib/generateRules' )
439
439
) . generateRules ,
440
440
} ,
441
+ setupContext : {
442
+ module : __non_webpack_require__ (
443
+ resolveFrom ( configDir , 'tailwindcss/lib/jit/lib/setupContext' )
444
+ ) . default ,
445
+ } ,
441
446
}
442
447
} catch ( _ ) {
443
448
try {
@@ -447,6 +452,11 @@ async function createProjectService(
447
452
resolveFrom ( configDir , 'tailwindcss/jit/lib/generateRules' )
448
453
) . generateRules ,
449
454
} ,
455
+ setupContext : {
456
+ module : __non_webpack_require__ (
457
+ resolveFrom ( configDir , 'tailwindcss/jit/lib/setupContext' )
458
+ ) ,
459
+ } ,
450
460
}
451
461
} catch ( _ ) { }
452
462
}
@@ -676,19 +686,7 @@ async function createProjectService(
676
686
state . classNames = ( await extractClassNames ( postcssResult . root ) ) as ClassNames
677
687
678
688
if ( state . jit ) {
679
- let setupContext
680
-
681
- try {
682
- setupContext = __non_webpack_require__ (
683
- resolveFrom ( path . dirname ( state . configPath ) , 'tailwindcss/lib/jit/lib/setupContext' )
684
- ) . default
685
- } catch ( _ ) {
686
- setupContext = __non_webpack_require__ (
687
- resolveFrom ( path . dirname ( state . configPath ) , 'tailwindcss/jit/lib/setupContext' )
688
- )
689
- }
690
-
691
- state . jitContext = setupContext ( state . configPath ) (
689
+ state . jitContext = state . modules . jit . setupContext . module ( state . configPath ) (
692
690
{ opts : { } , messages : [ ] } ,
693
691
state . modules . postcss . module . root ( )
694
692
)
You can’t perform that action at this time.
0 commit comments