tailwindcss/packages/@tailwindcss-node/src/require-cache.ts
Robin Malfait 12eb5ae7b6
Cleanup noisy test output (#20015)
This PR cleans up the noisy test output where some `console.warn`
messages were leaking into the test output.

This also uses the `src/` files instead of the `dist/` files of
`@tailwindcss/node` to get rid of a source map related warning in tests.
It also means that we don't have to rebuild `@tailwindcss/node` when we
make changes.

## Test plan

1. Existing tests pass
2. Output is clean when running tests (`vitest run --reporter=minimal`)

Before:
<img width="1193" height="1376" alt="image"
src="https://github.com/user-attachments/assets/9aceab62-cd99-4391-9734-0ae5c4c3fb48"
/>

After:
<img width="1099" height="294" alt="image"
src="https://github.com/user-attachments/assets/3ada4a0a-8a7a-48a7-9fbd-f3d5dd8700a5"
/>
2026-05-06 11:10:17 +02:00

5 lines
116 B
TypeScript

export function clearRequireCache(files: string[]) {
for (let key of files) {
delete require.cache[key]
}
}