mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
16 lines
615 B
TypeScript
16 lines
615 B
TypeScript
import * as Module from 'node:module'
|
|
import { pathToFileURL } from 'node:url'
|
|
export * from './compile'
|
|
|
|
// In Bun, ESM modules will also populate `require.cache`, so the module hook is
|
|
// not necessary.
|
|
if (!process.versions.bun) {
|
|
let localRequire = Module.createRequire(import.meta.url)
|
|
|
|
// `Module#register` was added in Node v18.19.0 and v20.6.0
|
|
//
|
|
// Not calling it means that while ESM dependencies don't get reloaded, the
|
|
// actual included files will because they cache bust directly via `?id=…`
|
|
Module.register?.(pathToFileURL(localRequire.resolve('@tailwindcss/node/esm-cache-loader')))
|
|
}
|