-
-
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
Bundle react-scripts package #335
Comments
See also #14. |
Still up for some experimentation? :D |
After some experimentation with bundling the package with webpack, I think it is going to be harder than than I initially thought. The biggest problem is dynamic imports, which are common in node packages. Webpack can process some forms like This also wouldn't be a common way to bundle a node package, so we might also hit other issues with 3rd party libraries later on. While webpack works with I think there aren't going to be any easy wins for the installation speed using this approach, but I'd be happy to be proved wrong. I'm closing this issue for now because I'm not going to work on it in the near future. |
Installing
react-scripts
from npm can take a few minutes on a reasonably fast internet connection. Increasing the size of dependencies and making the installation time longer is also something that limits us when considering new features like testing (#331).What if we pre-built
react-scripts
into one executable JS file with webpack, rollup or similar module bundler and published the package to npm with just that file? As all code would be in a single file (instead of 13k+ files currently installed tonode_modules
) and that file would presumably be a lot smaller than ~77 MB consumed by the separate packages, I would expect it to be very fast to install.I think this would solve a huge pain point in development using JS build tools:
npm install
takes a lot of time.react-scripts
is a single dependency that solves the basic build tool needs and if it installed very fast, the problem would basically be solved for projects using it.I don't know how well this would work in practice, it's just an idea at the moment, but I wanted to throw it here for discussion. What do you think? Are there any downsides to bundling the scripts like this?
The text was updated successfully, but these errors were encountered: