Creating multiple entry points in Create React App without ejecting
Blog post from LogRocket
The article explores the concept of adding multiple entry points to a Create React App (CRA) without ejecting, emphasizing the benefits of modularity, scalability, performance, and security. It guides readers on conditionally importing container files using environment variables to manage different build targets, thus preventing unwanted code from appearing in the final bundled build. Various solutions, such as using Lerna for monorepos and react-app-rewired for tweaking CRA build scripts, are discussed, but the focus is on achieving the goal without increasing complexity or relying on third-party dependencies. The article cautions against ejecting due to its irreversible nature and potential complications in maintaining custom configurations, suggesting it only as a last resort. Additionally, the piece highlights the importance of using tools like CommonJS and ES6 dynamic imports for optimal build management while maintaining the integrity and simplicity of the CRA configuration.