Lost reading my own code! React-Node project

It seems changes I make are not getting re-built.
My assumption is that webpack is not rebuilding anything and the code is just using the old bundle.js file.
(I have a couple of courses to watch which may help but they are several hours long.)
Here is the package json file.

{
  "name": "workspace",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "start": "node ./bin/www"
  },
  "dependencies": {
    "body-parser": "~1.15.2",
    "bcrypt": "^3.0.3",
    "chart.js": "^1.1.1",
    "connect-ensure-login": "^0.1.1",
    "cookie-parser": "~1.4.3",
    "debug": "~2.2.0",
    "dotenv": "^4.0.0",
    "express": "~4.14.0",
    "express-handlebars": "^3.0.0",
    "express-messages": "*",
    "express-session": "^1.14.2",
    "express-validator": "*",
    "handlebars": "^4.0.6",
    "hjs": "~0.0.6",
    "json-loader": "^0.5.4",
    "jsonwebtoken": "^7.4.3",
    "mongoose": "^4.7.3",    
    "passport": "^0.3.2",
    "passport-github2": "^0.1.10",
    "passport-http": "*",
    "passport-local": "*",
    "plotly.js": "^1.21.2",
    "react": "^15.4.1",
    "react-bootstrap": "^0.30.7",
    "react-chartjs": "^0.8.0",
    "react-chartjs-2": "^1.6.2",
    "react-dom": "^15.4.1",
    "serve-favicon": "~2.3.0",
    "superagent": "^3.3.1",
    "validator": "^8.1.0"
  },
  "devDependencies": {
    "babel-core": "^6.21.0",
    "babel-loader": "^6.2.10",
    "babel-preset-es2015": "^6.18.0",
    "babel-preset-react": "^6.16.0",
    "babel-preset-stage-0": "^6.16.0",
    "nodemon": "^1.12.1",
    "webpack": "^1.14.0"
  }
}

Update:
I am trying this which seems to be doing something…

  "scripts": {
    "start": "node server.js",
    "postinstall": "webpack"
  },

Lost reading my own code!

That’s normal :slight_smile:

nodemon will only restart server on change but you also need to trigger webpack. Change scripts to include both nodemon and webpack commands:

"scripts": {
  "start": "nodemon ./bin/www --exec 'npm run build'",
  "build": "webpack --watch"
}

I haven’t seen the code, but I guess you will need to configure both nodemon and webpack, so nodemon only watches server-side code and webpack watches your react script you’ll be shipping with HTML

Yes, that seems to be working. As I am using glitch, I remembered that you need to update package.json to trigger webpack to build again. :slight_smile: