@next/bundle-analyzer 15.4.0-canary.6 → 15.4.0-canary.61

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +17 -15
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1,23 +1,25 @@
1
1
  module.exports =
2
2
  ({ enabled = true, logLevel, openAnalyzer, analyzerMode } = {}) =>
3
3
  (nextConfig = {}) => {
4
+ if (!enabled) {
5
+ return nextConfig
6
+ }
7
+
4
8
  return Object.assign({}, nextConfig, {
5
9
  webpack(config, options) {
6
- if (enabled) {
7
- const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
8
- config.plugins.push(
9
- new BundleAnalyzerPlugin({
10
- analyzerMode: analyzerMode || 'static',
11
- logLevel,
12
- openAnalyzer,
13
- reportFilename: !options.nextRuntime
14
- ? `./analyze/client.html`
15
- : `../${options.nextRuntime === 'nodejs' ? '../' : ''}analyze/${
16
- options.nextRuntime
17
- }.html`,
18
- })
19
- )
20
- }
10
+ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer')
11
+ config.plugins.push(
12
+ new BundleAnalyzerPlugin({
13
+ analyzerMode: analyzerMode || 'static',
14
+ logLevel,
15
+ openAnalyzer,
16
+ reportFilename: !options.nextRuntime
17
+ ? `./analyze/client.html`
18
+ : `../${options.nextRuntime === 'nodejs' ? '../' : ''}analyze/${
19
+ options.nextRuntime
20
+ }.html`,
21
+ })
22
+ )
21
23
 
22
24
  if (typeof nextConfig.webpack === 'function') {
23
25
  return nextConfig.webpack(config, options)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next/bundle-analyzer",
3
- "version": "15.4.0-canary.6",
3
+ "version": "15.4.0-canary.61",
4
4
  "main": "index.js",
5
5
  "types": "index.d.ts",
6
6
  "license": "MIT",