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 {
7676 postcss ?: { version : string ; module : Postcss }
7777 postcssSelectorParser ?: { module : any }
7878 resolveConfig ?: { module : any }
79- jit ?: { generateRules : { module : any } }
79+ jit ?: { generateRules : { module : any } ; setupContext : { module : any } }
8080 }
8181 browserslist ?: string [ ]
8282 featureFlags ?: FeatureFlags
Original file line number Diff line number Diff line change @@ -438,6 +438,11 @@ async function createProjectService(
438438 resolveFrom ( configDir , 'tailwindcss/lib/jit/lib/generateRules' )
439439 ) . generateRules ,
440440 } ,
441+ setupContext : {
442+ module : __non_webpack_require__ (
443+ resolveFrom ( configDir , 'tailwindcss/lib/jit/lib/setupContext' )
444+ ) . default ,
445+ } ,
441446 }
442447 } catch ( _ ) {
443448 try {
@@ -447,6 +452,11 @@ async function createProjectService(
447452 resolveFrom ( configDir , 'tailwindcss/jit/lib/generateRules' )
448453 ) . generateRules ,
449454 } ,
455+ setupContext : {
456+ module : __non_webpack_require__ (
457+ resolveFrom ( configDir , 'tailwindcss/jit/lib/setupContext' )
458+ ) ,
459+ } ,
450460 }
451461 } catch ( _ ) { }
452462 }
@@ -676,19 +686,7 @@ async function createProjectService(
676686 state . classNames = ( await extractClassNames ( postcssResult . root ) ) as ClassNames
677687
678688 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 ) (
692690 { opts : { } , messages : [ ] } ,
693691 state . modules . postcss . module . root ( )
694692 )
You can’t perform that action at this time.
0 commit comments