gothinkster / react-redux-realworld-example-app

Exemplary real world application built with React + Redux
https://react-redux.realworld.io
MIT License
5.55k stars 2.5k forks source link

production build prunes dev dependencies such that the start command fails #106

Open simbo1905 opened 6 years ago

simbo1905 commented 6 years ago

A production build outputs:

---> Pruning the development dependencies

  | removed 829 packages in 7.631s

The start command then fails as both cross-env and react-scripts have been pruned as they are in devDependencies.

A production containerised build and deploy on OpenShift Kubernetes will run with:

  "scripts": {
    "start": "npm install -g serve ; PORT=8080 serve -s build",
    "build": "react-scripts build",
    "eject": "react-scripts eject"
  }

It shouldn't be the case that the start command is set to run devDependencies. Either those dependencies should be made prod dependencies else start command should be serve -s build and the cross-env and react-scripts start should be moved out of the default start into a dev-start (or similar). I would suggest the latter.