Questions tagged [react-scripts]

Package containing various scripts for running applications created via create-react-app

Package containing various scripts for running applications created via create-react-app

501 questions
325
votes
5 answers

What exactly is the 'react-scripts start' command?

I've been working with a React project using create-react-app and I have two options to start the project: First way: npm run start with the definition at the package.json like this: "start": "react-scripts start", Second way: npm start What is the…
Felipe Augusto
  • 7,733
  • 10
  • 39
  • 73
231
votes
5 answers

What does this "react-scripts eject" command do?

What does the npm run eject command do? I do understand what other commands do like start, build, test. But no idea about eject.
Ishan Patel
  • 5,571
  • 12
  • 47
  • 68
147
votes
6 answers

How to set build .env variables when running create-react-app build script?

I'm using the following environment variable in my create-react-app: console.log(process.env.REACT_APP_API_URL) // http://localhost:5555 It works when I run npm start by reading a .env file: REACT_APP_API_URL=http://localhost:5555 How do I set a…
sigmus
  • 2,987
  • 3
  • 23
  • 31
119
votes
6 answers

Relative path in index.html after build

Hello i have a reactjs app, and I build my project with bellow command npm build Here is my package.json file: "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", …
user3045654
  • 1,634
  • 2
  • 12
  • 21
79
votes
9 answers

How to configure react-script so that it doesn't override tsconfig.json on 'start'

I'm currently using create-react-app to bootstrap one of my projects. Basically, I'm trying to set up paths in tsconfig.json by adding these to the default tsconfig.json generated by create-react-app: "baseUrl": "./src", "paths": { "interfaces/*":…
CodeIntern
  • 1,370
  • 2
  • 11
  • 15
75
votes
22 answers

React app stuck on "Starting the development server"

I have a react app created by create-react-app. After running npm start (the start script is present in package.json as "start": "react-scripts start") the console says Starting the development server as usual and fires up the browser. But after…
kenneth-rebello
  • 914
  • 1
  • 7
  • 13
69
votes
2 answers

Difference between Webpack/Babel and react-scripts

Recently i started working on web pack and react-scripts and i would like to know the advantages and disadvantages using them and how they are different from each other.
user3335796
  • 1,227
  • 1
  • 17
  • 24
54
votes
6 answers

How to build a production version of React without minification?

Background I've been following more or less the official guide to setup a local dev environment with react and it seems to use create-react-app, which sets up really a lot. Now, if I run npm run build I get a minified version of everything in the…
rugk
  • 4,755
  • 2
  • 28
  • 55
53
votes
23 answers

Issue with babel-jest dependency when running npm start in a React app

All I am doing is running create-react-app and cd'ing into the app, then trying to run npm/yarn start. I get the following error/output/log. I have walked through all of the suggested steps. The only thing that works is the SKIP_PREFLIGHT_CHECK=true…
jasonspiller
  • 543
  • 1
  • 4
  • 6
52
votes
2 answers

Could not get uid/gid when building Node/Docker

My Dockerfile is using alpine and globally installing react-scripts. When it tries to install it, it fails with "could not get uid/gid" error. I added the "---unsafe-perm" option to the npm install -g command. The docker container is successfully…
user994165
  • 9,146
  • 30
  • 98
  • 165
46
votes
19 answers

'react-scripts' is not recognized as an internal or external command, operable program or batch file

I am learning to react. The version I installed is 16. I installed prop-types via npm after I got an error that 'react-scripts' is not recognized as an internal or external command, operable program or batch file."
David Essien
  • 1,463
  • 4
  • 22
  • 36
42
votes
2 answers

Webpack build vs react-scripts build

Say the webpack config is as follows { entry: path.join(__dirname, 'src', 'index.js'), output: { path: path.join(__dirname, 'build'), filename: 'bundle.js' }, Now the build from webpack is and the build from react-scripts build (…
magpie
  • 653
  • 1
  • 7
  • 12
41
votes
9 answers

How do I change `src` folder to something else in create-react-app

I'd like to know if it's possible using react-script to rename src to something else like app folder
rstormsf
  • 547
  • 1
  • 4
  • 9
39
votes
2 answers

How to run Jest tests with coverage for one file

I want to have coverage report for only one file that I am working on at the moment. It is a bit overwhelming to have the full table of coverage for the whole application files and then search for the one I need. What I tried was to run test for one…
Mario Petrovic
  • 7,500
  • 14
  • 42
  • 62
36
votes
12 answers

How stop after running react-scripts start?

I started a React app with npm start with start defined in package.json: { "name": "testreactapp", "version": "0.1.0", "private": true, "dependencies": { "react": "^15.6.1", "react-dom": "^15.6.1", "react-scripts": "1.0.10" …
user1837293
  • 1,466
  • 3
  • 16
  • 30
1
2 3
33 34