preboot / angular-webpack

A complete, yet simple, starter for Angular v2+ using webpack
MIT License
1.29k stars 557 forks source link

Is't possible to use BrowserSync? #309

Open biapar opened 7 years ago

biapar commented 7 years ago

Is't possible to use BrowserSync? If yes, How to include into?

ollwenjones commented 7 years ago

You'd have to include a devserver setup that is invoked in npm start, that includes the webpack-dev server middleware, without invoking webpack-dev-server directly.

First example that came to mind is a React seed project (sorry) but the BrowserSync + WebpackDevMiddleware setup should be pretty similar:

https://github.com/coryhouse/react-slingshot/blob/master/tools/srcServer.js

phil123456 commented 7 years ago

this maybe ? https://www.npmjs.com/package/browser-sync-webpack-plugin

maxx0r commented 7 years ago

What does browsersync add to the current setup?

On 30 Mar 2017 10:06, "phil123456" notifications@github.com wrote:

this maybe ? https://www.npmjs.com/package/browser-sync-webpack-plugin

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/preboot/angular-webpack/issues/309#issuecomment-290334268, or mute the thread https://github.com/notifications/unsubscribe-auth/ACWx9vFZCugQvhmP_PY3QsC5myFHM-3yks5rq2J-gaJpZM4MIcpN .

phil123456 commented 7 years ago

I dont know, cos indeed my browser if refreshing so I guess it's not needed

phra commented 7 years ago

@biapar see https://github.com/preboot/angular-webpack/pull/182 and https://github.com/preboot/angular-webpack/issues/180

ollwenjones commented 7 years ago

@maxx0r, @phil123456, browser-sync doesn't just refresh, it allows you to sync interactions across multiple browser instances at once. i.e. I can pull up the same ui in Chrome, FF, and Edge, and test all three at the same time, or the same UI at different browser sizes at the same time.

Not essential, but it is pretty handy.