Skip to content

Commit

Permalink
feat: Replace cosmiconfig with lilconfig to Work with Webpack
Browse files Browse the repository at this point in the history
Webpack will replace `require` and `import` by default, `lilconfig` is a zero-dependency laternative to `cosmiconfig` with the same API, and the most recent version handles the webpack case.
  • Loading branch information
labscale-huacongc committed Jun 17, 2024
1 parent db05338 commit 30c2e8a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 28 deletions.
4 changes: 2 additions & 2 deletions lib/logger.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
const { cosmiconfigSync } = require('cosmiconfig')
const { lilconfigSync } = require('lilconfig')

const defaultPinoConfig = require('./defaultPinoConfig')

let config = {}

const explorerSync = cosmiconfigSync('next-logger')
const explorerSync = lilconfigSync('next-logger')
const results = explorerSync.search()

if (results && results.config) {
Expand Down
71 changes: 46 additions & 25 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"testcontainers": "^10.9.0"
},
"dependencies": {
"cosmiconfig": "^8.1.3",
"lilconfig": "^3.1.2",
"pino": "^9.1.0"
},
"jest": {
Expand Down

0 comments on commit 30c2e8a

Please sign in to comment.