Download next.js/packages/next-bundle-analyzer/index.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 977 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next-bundle-analyzer/index.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/packages/next-bundle-analyzer/index.js
-
curl -L -o index.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/packages/next-bundle-analyzer/index.js
977 Bytes
| module.exports = | |
| ({ enabled = true, logLevel, openAnalyzer, analyzerMode } = {}) => | |
| (nextConfig = {}) => { | |
| if (!enabled) { | |
| return nextConfig | |
| } | |
| const extension = analyzerMode === 'json' ? '.json' : '.html' | |
| return Object.assign({}, nextConfig, { | |
| webpack(config, options) { | |
| const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer') | |
| config.plugins.push( | |
| new BundleAnalyzerPlugin({ | |
| analyzerMode: analyzerMode || 'static', | |
| logLevel, | |
| openAnalyzer, | |
| reportFilename: !options.nextRuntime | |
| ? `./analyze/client${extension}` | |
| : `../${options.nextRuntime === 'nodejs' ? '../' : ''}analyze/${ | |
| options.nextRuntime | |
| }${extension}`, | |
| }) | |
| ) | |
| if (typeof nextConfig.webpack === 'function') { | |
| return nextConfig.webpack(config, options) | |
| } | |
| return config | |
| }, | |
| }) | |
| } | |