Support `node:` module prefix (#585)
parent
d298014070
commit
0efcdd773e
|
@ -9,7 +9,10 @@ process.env.TAILWIND_DISABLE_TOUCH = 'true'
|
||||||
let oldResolveFilename = (Module as any)._resolveFilename
|
let oldResolveFilename = (Module as any)._resolveFilename
|
||||||
|
|
||||||
;(Module as any)._resolveFilename = (id: any, parent: any) => {
|
;(Module as any)._resolveFilename = (id: any, parent: any) => {
|
||||||
if (builtInModules.includes(id)) {
|
if (
|
||||||
|
typeof id === 'string' &&
|
||||||
|
(builtInModules.includes(id) || builtInModules.includes(id.replace(/^node:/, '')))
|
||||||
|
) {
|
||||||
return oldResolveFilename(id, parent)
|
return oldResolveFilename(id, parent)
|
||||||
}
|
}
|
||||||
return resolveFrom(path.dirname(parent.id), id)
|
return resolveFrom(path.dirname(parent.id), id)
|
||||||
|
|
Loading…
Reference in New Issue