Do I need to run “npm run build” every time I made changes?

So finally, I have found my solution. When you want to re-run “npm run build” every time a file changes. You need to install watch via npm. It checks all the files inside a directory and when you change something or on-save, it will re-run all the scripts inside package.json. So steps –

  1. Install watch by

    npm install watch
    
  2. When watch is installed, add

    "watch": "watch 'npm run build' ./directory-you-want-to-track"
    
  3. Run

    npm run watch
    

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)