I posted my question on S.O. here but will paste it below in case someone can resolve my issues:
Following this great article on how to use npm as a build tool, I would like to implement it when building a nodejs express web app.
My node app is created on port 8080, this is a simplified version of my server.js file:
The file that I'm watching before needing to reload is in www/js.
I am using npm as a build tool and before launching server.js with npm I launch a separate process that does watchify source/js/app.js -v -o wwww/js/bundle.js
I did checked that watchify works correctly, updating as I save my files. But there is no livereload once a file is changed.
The error I get in the console is:
Uncaught SyntaxError: Unexpected token <
and I can see that connect-livereload inserted this script in the html:
I tried also to use live-reload as mentionned in the original article but without success and I am not sure it's the right plugin to use as live-reload launches a server, when I already start one with express.
Any ideas?
I posted my question on S.O. here but will paste it below in case someone can resolve my issues:
Following this great article on how to use npm as a build tool, I would like to implement it when building a nodejs express web app. My node app is created on port 8080, this is a simplified version of my
server.js
file:The file that I'm watching before needing to reload is in
www/js
. I am usingnpm
as a build tool and before launchingserver.js
with npm I launch a separate process that doeswatchify source/js/app.js -v -o wwww/js/bundle.js
I did checked that watchify works correctly, updating as I save my files. But there is no livereload once a file is changed. The error I get in the console is:Uncaught SyntaxError: Unexpected token <
and I can see that connect-livereload inserted this script in the html:I tried also to use live-reload as mentionned in the original article but without success and I am not sure it's the right plugin to use as
live-reload
launches a server, when I already start one with express. Any ideas?