score:1
you could try this package https://github.com/nargonath/cra-build-watch
install it and add the script to your package.json
{
"scripts": {
"watch": "cra-build-watch"
}
}
and run it
npm run watch
more info here
https://ibraheem.ca/writings/cra-write-to-disk-in-dev/
and if you go to the react repo issue linked in the article you would find more workarounds
score:3
tl;dr
run npm run build
, not npm run start
more detail
react-scripts start
runs webpack-dev-server internally. as a default setting, webpack-dev-server serves bundled files from memory and does not write files in directory.
if you want to write files with webpack-dev-sever, you could set writetodisk option to true in your dev server configuration.
however, i dont think this is what you want to serve on firebase emulator. webpack-dev-server does not build optimal app for production, and you also need to use react-app-rewired to customize dev server configuration in cra template.
what you want to do is npm run build
to run react-scripts build
, which builds optimized production app in /build
directory.
Source: stackoverflow.com
Related Query
- Where does React put the continuous build files when using create-react-app
- The app build fails when using React Native CLI
- Why does my React app menu open when I am only changing the state and am not using any CSS?
- 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
- How to compress the files using gzip in react app
- How to create a preview (Image and description) to the Url when shared link on Social media,Gmail and Skype using React JS?
- React app is looking for static files in different location when using proxy
- Build files name change - files that are generated from create react app
- How to put the app in a subfolder when using create-react-app in Development mode?
- Writing to files using File System Access API fails in Electron + Create React App
- React app showing page with "404 the requested path could not be found" when using Apache
- Where to put theme file when using the gatsby-plugin-material-ui with gatsby?
- Using LESS CSS with the latest Create React App
- Disable the bundle.js bundling file Webpack creates in React using Create React App or Craco? Or at least get 'Performance' to work with source maps
- How to determine the order of css in my create react app build with webpack and customize-cra?
- Why does the render function in react is called twice when using the component strategy?
- React lifecycle methods. When does an app render to the screen?
- How create a react app with a specific version using the npx command?
- How does react know where to put the cursor while typing inside an input element?
- React / Redux: where do I create + put the 'master' application state?
- Why does my react app go to the custom 404 not found page when the link is clicked?
- When attempting to stub a request in Cypress IO (JS) against a React app using fetch, the requests still call through to the server
- What is the best way to include css files for Prime React components when using Parceljs?
- Why does react re-render twice when using the state hook (useState)?
- How can I get rid of the `Node "13.0.0-nightly20190802452b393c1f"` so that I can be able to create a react app using the `create-react-app` tool?
- Is there a way to load react library files separately and not in the bundled files when using react with babel, webpack and gulp as building tool?
- Where is the appropriate place to put font-awesome files in React apps?
- Which is the best way to store a list of data in localStorage and display them when searched using a React app
- In react js i create a todo app but when i am doing todo-delete it by default delete the first item why?
- My React 18 app does not reload automatically I try to click on the create new project button does not work unless I refresh the page manually
More Query from same tag
- histroy.push() is not working in react router, if my base route is same
- @testing-library/jest-dom not loading
- socket.io v.4 How to get list of sockets already in room when joining
- React Jquery Datatable
- How do I solve this error"Uncaught Error: [News] is not a <Route> component. All component children of <Routes> must be a <Route>or <React.Fragment>"?
- React production using react-app-rewired nginx
- "no-unused-expressions" error in react with map function
- Element implicitly has an 'any' type because expression of type 'number' can't be used to index type 'Number'
- Problem with setState looping inside an array Next.js
- React Native and JSON file parsing
- How to install SSL for the following setup (React Frontend + Nodejs Backend + Custom Domain Heroku)
- react bootstrap-table csv exporting with mimetype
- How to pass props onClick in React
- How to authenticate users with Social Login (Facebook, Google) in a REST API backend with Spring Boot (separate React Frontend)
- Form elements in React are immutable when I'm using value="this.state.value" and onChange
- horizontally align a list of components in react.js
- Can we make changes on screen/browser without using hooks in ReactJS. (In case of functional component)?
- input value is not accepting this.state.term
- Custom radio button border color
- Getting error while using React Router Dom
- Type '({ items }: PropsWithChildren<TodoProps>) => Element[]' is not assignable to type 'FunctionComponent<TodoProps>'
- Incrementing state value by one using React
- ReactJS: How to display selected value from dropdown in input fields?
- How to create a nested react componet?
- webpack-dev-server not running (ECONNREFUSED)
- How to have this format "2020-08-08T03:20:14.362+00:00"
- How to rename object data response in React
- Next.js getStaticProps localstorage is not defined
- How to call a function which is inside a class in React?
- Is it possible to decouple re-rendering of some components when specific states change in react hooks?