Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
19fa1fa5
Unverified
Commit
19fa1fa5
authored
Dec 06, 2023
by
quisi.do
Committed by
GitHub
Dec 06, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add `logLevel` support to `@next/bundle-analyzer` (#59228)
Co-authored-by:
Jiachi Liu
<
inbox@huozhi.im
>
parent
7a733dfd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
index.d.ts
packages/next-bundle-analyzer/index.d.ts
+6
-0
index.js
packages/next-bundle-analyzer/index.js
+2
-1
No files found.
packages/next-bundle-analyzer/index.d.ts
View file @
19fa1fa5
...
@@ -4,6 +4,12 @@ declare function NextBundleAnalyzer(options?: {
...
@@ -4,6 +4,12 @@ declare function NextBundleAnalyzer(options?: {
enabled
?:
boolean
enabled
?:
boolean
openAnalyzer
?:
boolean
openAnalyzer
?:
boolean
analyzerMode
?:
'json'
|
'static'
analyzerMode
?:
'json'
|
'static'
/**
* Log level. Can be 'info', 'warn', 'error' or 'silent'.
* @default 'info'
*/
logLevel
?:
'info'
|
'warn'
|
'error'
|
'silent'
|
undefined
}):
(
config
?:
NextConfig
)
=>
NextConfig
}):
(
config
?:
NextConfig
)
=>
NextConfig
export
=
NextBundleAnalyzer
export
=
NextBundleAnalyzer
packages/next-bundle-analyzer/index.js
View file @
19fa1fa5
module
.
exports
=
module
.
exports
=
({
enabled
=
true
,
openAnalyzer
,
analyzerMode
}
=
{})
=>
({
enabled
=
true
,
logLevel
,
openAnalyzer
,
analyzerMode
}
=
{})
=>
(
nextConfig
=
{})
=>
{
(
nextConfig
=
{})
=>
{
return
Object
.
assign
({},
nextConfig
,
{
return
Object
.
assign
({},
nextConfig
,
{
webpack
(
config
,
options
)
{
webpack
(
config
,
options
)
{
...
@@ -8,6 +8,7 @@ module.exports =
...
@@ -8,6 +8,7 @@ module.exports =
config
.
plugins
.
push
(
config
.
plugins
.
push
(
new
BundleAnalyzerPlugin
({
new
BundleAnalyzerPlugin
({
analyzerMode
:
analyzerMode
||
'static'
,
analyzerMode
:
analyzerMode
||
'static'
,
logLevel
,
openAnalyzer
,
openAnalyzer
,
reportFilename
:
!
options
.
nextRuntime
reportFilename
:
!
options
.
nextRuntime
?
`./analyze/client.html`
?
`./analyze/client.html`
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment