mern-starter
mern-starter copied to clipboard
Error: Cannot find module 'webpack' on production environment
Why is it webpack needed for production environment even after I build for production? Steps to reproduce:
- mern init foo
- cd foo
- npm install
- npm start // => runs OK
- npm run build
- npm run build:server
- rm -rf node_modules
- npm install --production
- npm run start:prod
- error
I believe those are the steps to deploy in production mode and npm install --production is what we should do, but that render the app unusable. If that's not the case then webpack and its plugins should be in dependencies
and not in devDependencies
in package.json
.
Same issue found, anyone could help?