mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
Merge pull request #780 from t4d-io-website/master
fix require.main for use with Node.js mjs modules
This commit is contained in:
commit
bd7097a8a4
@ -34,7 +34,7 @@ const tryLoading = (modulePath, config) => {
|
||||
const loadAppenderModule = (type, config) => coreAppenders.get(type) ||
|
||||
tryLoading(`./${type}`, config) ||
|
||||
tryLoading(type, config) ||
|
||||
tryLoading(path.join(path.dirname(require.main.filename), type), config) ||
|
||||
(require.main && tryLoading(path.join(path.dirname(require.main.filename), type), config)) ||
|
||||
tryLoading(path.join(process.cwd(), type), config);
|
||||
|
||||
const createAppender = (name, config) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user