Skip to content

Commit

Permalink
chore: Remove cache directory created by ts-import.
Browse files Browse the repository at this point in the history
  • Loading branch information
darkobits committed Jun 22, 2023
1 parent c78c623 commit ce0db75
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib/configuration-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,15 +147,17 @@ async function withTsImport(filePath: string) {
// Slower, but allows files to be considered as part of larger TypeScript
// programs, which should allow path mappings to work.
mode: tsImport.LoadMode.Compile,
// N.B. Even with this set to false, ts-import still seems to create (and
// leave behind) a .cache directory.
useCache: false
});

// Clean-up the cache directory left behind by ts-import.
// try {
// await fs.remove(path.join(path.dirname(filePath), '.cache'));
// } catch (err: any) {
// log.error(log.prefix('ts-import'), 'Error removing cache directory:', err);
// }
try {
await fs.remove(path.join(path.dirname(filePath), '.cache'));
} catch (err: any) {
log.error(log.prefix('ts-import'), 'Error removing cache directory:', err);
}

return result?.default || result;
}
Expand Down

0 comments on commit ce0db75

Please sign in to comment.