Unverified Commit 19fa1fa5 authored by quisi.do's avatar quisi.do Committed by GitHub

add `logLevel` support to `@next/bundle-analyzer` (#59228)

Co-authored-by: 's avatarJiachi Liu <inbox@huozhi.im>
parent 7a733dfd
......@@ -4,6 +4,12 @@ declare function NextBundleAnalyzer(options?: {
enabled?: boolean
openAnalyzer?: boolean
analyzerMode?: 'json' | 'static'
/**
* Log level. Can be 'info', 'warn', 'error' or 'silent'.
* @default 'info'
*/
logLevel?: 'info' | 'warn' | 'error' | 'silent' | undefined
}): (config?: NextConfig) => NextConfig
export = NextBundleAnalyzer
module.exports =
({ enabled = true, openAnalyzer, analyzerMode } = {}) =>
({ enabled = true, logLevel, openAnalyzer, analyzerMode } = {}) =>
(nextConfig = {}) => {
return Object.assign({}, nextConfig, {
webpack(config, options) {
......@@ -8,6 +8,7 @@ module.exports =
config.plugins.push(
new BundleAnalyzerPlugin({
analyzerMode: analyzerMode || 'static',
logLevel,
openAnalyzer,
reportFilename: !options.nextRuntime
? `./analyze/client.html`
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment