File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
packages/tailwindcss-language-server/src Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export default class Hook {
2020 private _origRequire = Module . prototype . require
2121 private _require : ( req : string ) => any
2222
23- constructor ( find : string , callback : ( x ) => { } ) {
23+ constructor ( find : string , callback : ( x ) => { } = ( x ) => x ) {
2424 // @ts -ignore
2525 if ( typeof Module . _resolveFilename !== 'function' ) {
2626 throw new Error (
Original file line number Diff line number Diff line change @@ -910,9 +910,14 @@ async function createProjectService(
910910 let hook : Hook
911911
912912 if ( loadConfig . module ) {
913- originalConfig = await loadConfig . module ( state . configPath )
914- originalConfig = originalConfig . default ?? originalConfig
915- state . jit = true
913+ hook = new Hook ( fs . realpathSync ( state . configPath ) )
914+ try {
915+ originalConfig = await loadConfig . module ( state . configPath )
916+ originalConfig = originalConfig . default ?? originalConfig
917+ state . jit = true
918+ } finally {
919+ hook . unhook ( )
920+ }
916921 } else {
917922 hook = new Hook ( fs . realpathSync ( state . configPath ) , ( exports ) => {
918923 originalConfig = klona ( exports )
You can’t perform that action at this time.
0 commit comments