Skip to content

Commit

Permalink
fix: invalidate config cache
Browse files Browse the repository at this point in the history
  • Loading branch information
sibbng committed Mar 26, 2021
1 parent 63a5c3e commit efde3ff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export const loadFile = <T>(file: string, cwd = process.cwd()): T => {

require('sucrase/register')

// node.js caches required imports (fixes: https://github.com/tw-in-js/twind-cli/issues/2#issuecomment-808122306)
delete require.cache[Path.resolve(cwd, file)]

// eslint-disable-next-line @typescript-eslint/no-var-requires
return require(Path.resolve(cwd, file)) as T

Expand Down

0 comments on commit efde3ff

Please sign in to comment.