4 ms·
> React is 275K (nearly a quarter of a meg) when it is minified and gzipped. 750K when it is not minified/gziped. That statement is completely false. react@15
by fonybalony 9y ago
> React is 275K (nearly a quarter of a meg) when it is minified and gzipped. 750K when it is not minified/gziped.
That statement is completely false.
react@15.5.4:
react.min.js is 21335 bytes uncompressed, 7353 bytes gzipped.
- codazoda 9y agoI'm including everything you need to deploy in those numbers. You included only React and not React-Dom. My own try at setting up React results in a 750k js file when I follow the instructions below. I realize this isn't minified yet and I welcome feedback on how to make it better. https://www.joeldare.com/blog/post/create-a-react-app/ https://www.joeldare.com/blog/post/create-a-react-app/ The top search results for react minified size show similar numbers to my 250k. There are a lot of people throwing out a lot of numbers that are different. Versions likely play a role, especially after 15. Here are some references. https://gist.github.com/Restuta/cda69e50a853aa64912d https://gist.github.com/Restuta/cda69e50a853aa64912d https://stackoverflow.com/questions/19807946/why-is-reacts-filesize-so-big-given-its-small-api https://stackoverflow.com/questions/19807946/why-is-reacts-f... Nothing I can find references a size as small as you mention with react and react dom. Most recommend writing with ES2016 which probably adds Babel overhead as well. When I build "Hello World" myself, I can't get anywhere near the small sizes. I'd love someone to give me a proper smack-down on this. I want to love React since it's a recent requirement of my job. But with my current knowledge of it, I can't seem to get the size down.
- fonybalony 9y agoYou need to add uglify to your webpack.config.js. https://webpack.github.io/docs/list-of-plugins.html#uglifyjsplugin https://webpack.github.io/docs/list-of-plugins.html#uglifyjs...
- deleted 9y ago[deleted]