Do not register ESM hook in Bun
This commit is contained in:
parent
c42664cc6f
commit
5789eb789d
1 changed files with 7 additions and 3 deletions
|
|
@ -1,5 +1,9 @@
|
|||
import { createRequire, register } from 'node:module'
|
||||
import * as Module from 'node:module'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
let localRequire = createRequire(import.meta.url)
|
||||
|
||||
register(pathToFileURL(localRequire.resolve('@tailwindcss/node/esm-cache-loader')))
|
||||
// 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(pathToFileURL(localRequire.resolve('@tailwindcss/node/esm-cache-loader')))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue