diff --git a/lib/appenders/index.js b/lib/appenders/index.js index d7408b8..cd7ad96 100644 --- a/lib/appenders/index.js +++ b/lib/appenders/index.js @@ -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) => {