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 {
20
20
private _origRequire = Module . prototype . require
21
21
private _require : ( req : string ) => any
22
22
23
- constructor ( find : string , callback : ( x ) => { } ) {
23
+ constructor ( find : string , callback : ( x ) => { } = ( x ) => x ) {
24
24
// @ts -ignore
25
25
if ( typeof Module . _resolveFilename !== 'function' ) {
26
26
throw new Error (
Original file line number Diff line number Diff line change @@ -910,9 +910,14 @@ async function createProjectService(
910
910
let hook : Hook
911
911
912
912
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
+ }
916
921
} else {
917
922
hook = new Hook ( fs . realpathSync ( state . configPath ) , ( exports ) => {
918
923
originalConfig = klona ( exports )
You can’t perform that action at this time.
0 commit comments