It's my belief that the purpose of create-react-app
is to provide convenient defaults for your project's build configuration and offer a foundational template for your application's project structure. The idea is to streamline the process of building your application without having to worry about setting up various build configurations like asset bundling with Webpack
, JavaScript code transpilation with babel
, and linting. While create-react-app
is a helpful starting point for most web applications, it may not address specific performance needs that arise as your application scales. Just like following a workout or diet plan can lay the foundation for physical fitness, it's the individual customization that can make a significant difference in achieving optimal results. Similarly, actors, athletes, and others have personal coaches and dieticians to tailor their plans for success on an individual level.
- It's advisable to back up your source code on a version control system before making any changes to prevent any potential issues that may arise. Then, create a separate branch from the main branch to work on.
You have two options to consider:
- While most build configuration settings are contained within
react-scripts
node module, accessible in webpack.config.js
, you could try editing this file directly without ejecting. Be cautious not to inadvertently alter any existing configurations. If needed, you can always revert back by reinstalling react-scripts
. This approach allows you to experiment with customizations in a controlled environment.
- If customization requirements due to scalability demand it, you may need to eject from the default configurations provided by
create-react-app
. While this may seem daunting, it grants you the freedom to create a bespoke configuration tailored to your needs. Remember, create-react-app
simply offers useful defaults, and ejecting puts you in full control of your project moving forward.
I wish you the best of luck in finding a solution that works for you. If you discover an elegant solution, please do share it with others. I'm open to being proven wrong :)