-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
request: produce two JS bundles - lib and app #536
Comments
it will be nice if the build generate one hashed vendor bundle (modules imported from node_modules) and one app hashed bundle. |
@stoyan The only dependencies that all @HatemJerbi The benefit would be small I think? Often changing your app code will use more/less of the library code, which will mean that the uglified version of your 'node_modules' bundle will be different. |
@tbillington yeah, I guess so. I just created a test app, deleted everything except index.js and built. The result is 160K (46K after gzip) of stuff. So ideally this can be shared between all apps, it's independent of the application code. Question: When does |
@stoyan It gets react+dom when you generate a new app. |
@stoyan you could do something like eject (or modify the internal of react-scripts) to tell webpack to assume react is provided by the environment, then link to react on a cdn in your html. That way your app will not bundle react which will greatly reduce the size, and you get cdn benefits. The 160kb base blob you mentioned is essentially just react and webpack module wrapping + some polyfill as far as I know.. |
We tried this before in #210 and found some issues with Webpack. I want to revisit this after Webpack 2 is declared stable and we switch to using it. |
One e.g.
create-react-app-v0.2.js
that can be hosted by volunteering CDNs and shared among all the apps and another onebundle.js
that is app-specificThe text was updated successfully, but these errors were encountered: