Join the Stack Overflow Community
Stack Overflow is a community of 6.8 million programmers, just like you, helping each other.
Join them; it only takes a minute:
Sign up

I'm developing an Angular 2 app using angular cli. I'm also using gulp as a task runner in the project. I want to use BrowserSync with gulp instead of the default ember live reload plugin that angular cli provides with. I have tried using proxy option in gulp browserSync to that of the default ng serve port ie: 4200. But then when gulp is running, I'm unable to run the project (ng serve). So can anyone please help me with this problem as I want to run browserSync with gulp. This might be a very n00b question as I'm new to gulp and angular, but help would be appreciated. Thanks.

Update: I was able to connect to BrowserSync using gulp but then the changes that I had made weren't getting updated either in the /dist folder or in the browser.

share|improve this question
up vote 0 down vote accepted

If you're still using ng serve, then you should know that all the files are only compiled in-memory. So there are no file changes for BrowserSync to reload.

Instead, use ng build --watch, which will watch for file changes and automatically build to your /dist folder. Then use BrowserSync to serve from there.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.