mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Fix a crash with older Node.js versions (#14342)
Closes #14341 --------- Co-authored-by: Jordan Pittman <jordan@cryptica.me>
This commit is contained in:
parent
2dd52f5a0f
commit
a3a16e64d2
@ -21,6 +21,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Evaluate theme functions in plugins and JS config files ([#14326](https://github.com/tailwindlabs/tailwindcss/pull/14326))
|
||||
- Ensure theme values overridden with `reference` values don't generate stale CSS variables ([#14327](https://github.com/tailwindlabs/tailwindcss/pull/14327))
|
||||
- Don’t suggest named opacity modifiers in intellisense ([#14339](https://github.com/tailwindlabs/tailwindcss/pull/14339))
|
||||
- Fix a crash with older Node.js versions ([#14342](https://github.com/tailwindlabs/tailwindcss/pull/14342))
|
||||
|
||||
## [4.0.0-alpha.21] - 2024-09-02
|
||||
|
||||
|
||||
@ -5,5 +5,9 @@ export * from './compile'
|
||||
// In Bun, ESM modules will also populate `require.cache`, so the module hook is
|
||||
// not necessary.
|
||||
if (!process.versions.bun) {
|
||||
Module.register(pathToFileURL(require.resolve('@tailwindcss/node/esm-cache-loader')))
|
||||
// `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(require.resolve('@tailwindcss/node/esm-cache-loader')))
|
||||
}
|
||||
|
||||
@ -6,5 +6,10 @@ export * from './compile'
|
||||
// not necessary.
|
||||
if (!process.versions.bun) {
|
||||
let localRequire = Module.createRequire(import.meta.url)
|
||||
Module.register(pathToFileURL(localRequire.resolve('@tailwindcss/node/esm-cache-loader')))
|
||||
|
||||
// `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')))
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user