Laravel-mix: NPM run dev using --watch-poll automatically ends the process after compiling

Created on 6 Jan 2017  路  2Comments  路  Source: JeffreyWay/laravel-mix

normal npm run dev without -poll does not read file changes. so I added the -poll flag
but the the problem is after I run the npm run dev after compiling it automatically ends the process making it the same as running npm run webpack

  • Windows 10
  • Latest Laravel Homestead
{
  "private": true,
  "scripts": {
    "webpack": "cross-env NODE_ENV=development webpack --progress --hide-modules",
    "dev": "cross-env NODE_ENV=development webpack --watch-poll --progress --hide-modules",
    "hmr": "cross-env NODE_ENV=development webpack-dev-server --inline --hot",
    "production": "cross-env NODE_ENV=production webpack --progress --hide-modules"
  },
  "devDependencies": {
    "axios": "^0.15.3",
    "gulp": "^3.9.1",
    "laravel-mix": "^0.2.10",
    "lodash": "^4.16.2",
    "vue": "^2.0.1"
  }
}

Most helpful comment

@JeffreyWay I was having an issue with npm run watch not working on Homestead. I added --watch-poll to my script and now all is good. Might be a good idea to add that to the package.json file?

All 2 comments

Try:

 "dev": "cross-env NODE_ENV=development webpack --watch --watch-poll --progress --hide-modules"

@JeffreyWay I was having an issue with npm run watch not working on Homestead. I added --watch-poll to my script and now all is good. Might be a good idea to add that to the package.json file?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mstralka picture mstralka  路  3Comments

amin101 picture amin101  路  3Comments

kpilard picture kpilard  路  3Comments

RomainGoncalves picture RomainGoncalves  路  3Comments

rlewkowicz picture rlewkowicz  路  3Comments