Open slorber opened 7 months ago
require-like uses Module._load, an API that is not supported by Bun (atm): https://github.com/oven-sh/bun/issues/5925
require-like
Module._load
This led to bugs in Docusaurus Bun support: https://github.com/oven-sh/bun/issues/3426#issuecomment-1929173528
This can be prevented by using this Node API instead of the very old require-like code:
const module = require("module"); const sandbox = { require: module.createRequire(_filename); }
This seems to be the "modern" way to achieve the same behavior, using a built-in API, and would get rid of a useless dependency. (and this would permit to use this lib in Bun, until they support the older Module apis)
require-like
usesModule._load
, an API that is not supported by Bun (atm): https://github.com/oven-sh/bun/issues/5925This led to bugs in Docusaurus Bun support: https://github.com/oven-sh/bun/issues/3426#issuecomment-1929173528
This can be prevented by using this Node API instead of the very old
require-like
code:This seems to be the "modern" way to achieve the same behavior, using a built-in API, and would get rid of a useless dependency. (and this would permit to use this lib in Bun, until they support the older Module apis)