Skip to content

Add webpack-bundle-analyzer to a react-app-rewired config.

License

Notifications You must be signed in to change notification settings

byzyk/react-app-rewire-webpack-bundle-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

react-app-rewire-webpack-bundle-analyzer

npm License

Add webpack-bundle-analyzer to react-app-rewired config.

Install

npm install --save-dev react-app-rewire-webpack-bundle-analyzer

Usage

const rewireWebpackBundleAnalyzer = require('react-app-rewire-webpack-bundle-analyzer')

module.exports = function override(config, env) {
  // ...

  if (env === 'production') {
    config = rewireWebpackBundleAnalyzer(config, env, {
      analyzerMode: 'static',
      reportFilename: 'report.html'
    })
  }

  return config
}

License

MIT © Bohdan Khodakivskyi