score:169
Under the hood, Create React App uses Webpack with html-webpack-plugin.
Our configuration specifies that Webpack uses src/index.js
as an “entry point”. So that’s the first module it reads, and it follows from it to other modules to compile them into a single bundle.
When webpack compiles the assets, it produces a single (or several if you use code splitting) bundles. It makes their final paths available to all plugins. We are using one such plugin for injecting scripts into HTML.
We have enabled html-webpack-plugin to generate the HTML file. In our configuration, we specified that it should read public/index.html
as a template. We have also set inject
option to true
. With that option, html-webpack-plugin
adds a <script>
with the path provided by Webpack right into the final HTML page. This final page is the one you get in build/index.html
after running npm run build
, and the one that gets served from /
when you run npm start
.
Hope this helps! The beauty of Create React App is you don’t actually need to think about it.
Source: stackoverflow.com
Related Query
- What is the difference between NextJs and Create React App
- How to determine the order of css in my create react app build with webpack and customize-cra?
- What's the difference between functional component and create component using useMemo() in React
- Create internal connection between React and Laravel in Docker containers on server
- how to communicate between a root React component and the rest of the app using Redux?
- NodeJS: What's the best way to share session between server-rendered views and React app
- I am trying to create a react app using the "npx/npm create-react-app hello" command and got this whole message
- Uncaught Error: Invalid hook call. Hooks can only be called inside of the body of a function component when using Create React App and Formik
- Static files are not being served due to connection issues between the client and the backend in a MERN stack app
- What is the difference between React Native and React?
- What's the difference between "super()" and "super(props)" in React when using es6 classes?
- How to create a React app directly in the current folder
- Where's the connection between index.html and index.js in a Create-React-App application?
- What's the difference between hydrate() and render() in React 16?
- What is the difference between hashHistory and browserHistory in react router?
- Error when deploying react app and it keeps sayings << Plugin "react" was conflicted between "package.json » eslint-config-react-app » >>
- The react-scripts package provided by Create React App requires a dependency:
- Specify specific props and accept general HTML props in Typescript React App
- Can we share code between react webapp and react native app and is react-native production ready
- React Native - What is the difference between StyleSheet.absoluteFill() and StyleSheet.absoluteFillObject()?
- You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.0). We no longer support global installation of Create React App
- What is the main difference between React Query and Redux?
- What's the difference between a JavaScript function and a React hook?
- React - What is the difference between renderToString and renderToStaticMarkup
- Create React App not installing, showing an error and aborting installation
- What's the difference between importing React's Fragment from React and React, { Fragment }?
- How to inject port and host using ENV variable in Create React App Proxy settings?
- React Hooks: What is the difference between 'useMutationEffect' and 'useLayoutEffect'?
- Javascript: What is eslintcache file and why is always generated in create react app
- What's the easiest way to use Create React App with Relay?
More Query from same tag
- JS/ReactJS - Assigning a new variable changes the original
- How to solve TypeScript typing issue with component composition
- How to add "plus-button" on top right in material-table for react and call my specific function in react
- Cannot use import statement outside a module error in React JS + JEST + Antd
- <Route component> and <Route children> in the same route
- Jest - mock function runs but .toHaveBeenCalledTimes() stays 0
- Force React to render String object as string literal
- ASP.NET Core project with NextJS
- Trigger onchange when adding/removing an option on a select (ReactJs)
- Method is undefined, while being defined a couple lines up
- Why need to pass a callback accepting the previous state?
- 'Line-through' style in react blinking for some reason
- Access Key of Map Created Component
- Can't get jQuery .attr() to work with ReactJS
- Map method keeps returning an array of objects causing an errror in React
- Pages are merging for Reactjs routing?
- How to make an array unique by object key?
- search filter by name in react using input
- Cannot create a React app with create-react-app
- Redux TS Error Actions must be plain objects. Instead, the actual type was: 'Promise'
- re-render a functional component on prop change
- Is there a neater way to connect an input field to a state property in React than onChange?
- How to disable Chrome autocomplete feature?
- How to process everytime component is visibile?
- set countdown timer React JS
- Taking React State (object of objects(example inside)) and getting an array of objects to map() for component rendering
- How to make a React component ‘communicate’ with another React component?
- Modifying object in this.state of a React component
- next.js redirect on getServerSideProps throwing error about props
- React Number Easing