-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Next.js patches into their own file
This refactors the Next.js logger patches into their own file, to be imported in the `index` file. This a precursor to presets.
- Loading branch information
1 parent
fdd94d8
commit 0e1fabd
Showing
5 changed files
with
16 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
* | ||
!index.js | ||
!lib/* | ||
!lib/**/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1 @@ | ||
const LOGGER_PATH = require('path').join(process.cwd(), 'node_modules', 'next/dist/build/output/log') | ||
|
||
// eslint-disable-next-line import/no-dynamic-require | ||
const nextLogger = require(LOGGER_PATH) | ||
|
||
const buildJsonLogger = require('./lib/jsonLogger') | ||
|
||
Object.entries(nextLogger).forEach(([key, value]) => { | ||
if (typeof value === 'function') { | ||
nextLogger[key] = buildJsonLogger(key) | ||
} | ||
}) | ||
require('./lib/patches/next') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const LOGGER_PATH = require('path').join(process.cwd(), 'node_modules', 'next/dist/build/output/log') | ||
|
||
// eslint-disable-next-line import/no-dynamic-require | ||
const nextLogger = require(LOGGER_PATH) | ||
|
||
const buildJsonLogger = require('../jsonLogger') | ||
|
||
Object.entries(nextLogger).forEach(([key, value]) => { | ||
if (typeof value === 'function') { | ||
nextLogger[key] = buildJsonLogger(key) | ||
} | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters