Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address create-react-app issue #213

Open
valscion opened this issue Oct 3, 2018 · 2 comments
Open

Address create-react-app issue #213

valscion opened this issue Oct 3, 2018 · 2 comments

Comments

@valscion
Copy link
Member

valscion commented Oct 3, 2018

facebook/create-react-app#4563 (comment)

I'm opening this issue here just so we don't forget about this.

@jtiscione
Copy link

So I guess once I update react-scripts to 2.0, this is the command to run webpack-bundle-analyzer on a CRA 2.0 app, right?

npm run build -- --stats && webpack-bundle-analyzer build/bundle-stats.json

(That's from the diff where they stripped the docs out of the README for CRA 2.0.)

I have webpack-bundle-analyzer 2.13.1 working with CRA/react-scripts 1.0 using this code

process.env.NODE_ENV = 'production';
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer')
  .BundleAnalyzerPlugin;
const webpackConfigProd = require('react-scripts/config/webpack.config.prod');
webpackConfigProd.plugins.push(new BundleAnalyzerPlugin({
  analyzerMode: 'static',
  reportFilename: 'report.html',
}));
require('react-scripts/scripts/build');

What was the reason the one-line script got stripped from the docs?

-Jason

@valscion
Copy link
Member Author

valscion commented Oct 8, 2018

So I guess once I update react-scripts to 2.0, this is the command to run webpack-bundle-analyzer on a CRA 2.0 app, right?

Yes, that's the way ☺️

What was the reason the one-line script got stripped from the docs?

The current UI can be misleading and create-react-app has more strict guidelines on what is acceptable before it can be promoted in the CRA docs.

Also the docs shouldn't have been merged before 2.0 was a thing, as it would've been way too confusing for people reading the README over at CRA GitHub repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants