Skip to content

Commit

Permalink
Merge pull request #3 from sibbng/patch-1
Browse files Browse the repository at this point in the history
fix: invalidate config cache
  • Loading branch information
sastan committed Mar 27, 2021
2 parents 63a5c3e + efde3ff commit eb05e2d
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 eb05e2d

Please sign in to comment.