Entry points

Entry points are used to tell Webpack where to start looking for modules used to build your application. With a simple application, you don't need anything more than a single file as your entry point. For example, this could be your index.js file that's used to render your root React component. Another way to think of this entry point, borrowing terminology from other programming languages, is the main program.

The react-scripts package looks for an index.js file in your source folder when you run the start script. It adds a couple of other entry points as well:

  • Polyfills for Promise, fetch(), and Object.assign(). These are only used if they don't already exist in the target browser.
  • A client for hot module reloading.

These last two entry points are valuable for React development, but they're not something you want to have to think about when you're trying to get a project off the ground.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.168.56