Is there a way to watch for code changes, and automatically reload the browser using only npm and package.json (I'm trying to avoid using Gulp et al. ) If so, can you suggest some scripts to accomplish this?
Asked
Active
Viewed 728 times
1 Answers
0
I just had the same issue and ended up using the pipe operator, which runs tasks concurrently. For example:
cp -R css src/css && watchify src/js/main.js -o src/js/bundle.min.js | node bs.js
Which is essentially: copy the CSS, then run watchify and browser-sync concurrently.
From a quick skim of the link below, I think the issue is with this is will only work on Mac OS and Linux, not Windows. For that you can use concurrently.
More discussion of this here: How can I run multiple NPM scripts in parallel?

Community
- 1
- 1

Jon Higgins
- 176
- 1
- 3