You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,12 +26,10 @@ var app = express();
26
26
27
27
if (app.get('env') =='development') {
28
28
var browserSync =require('browser-sync');
29
-
var bs =browserSync.init([], {});
29
+
var bs =browserSync({ logSnippet:false});
30
30
app.use(require('connect-browser-sync')(bs));
31
31
}
32
32
33
-
app.use(app.router);
34
-
35
33
// Routes and handlers...
36
34
```
37
35
@@ -40,9 +38,13 @@ See the [BrowserSync API docs](http://www.browsersync.io/docs/api/) for initiali
40
38
## Notes
41
39
42
40
- The `app.use` statement must come before any handlers that you want to integrate with BrowserSync. This includes dynamic handlers (e.g. `app.use(app.router);`) and static handlers (e.g. `app.use(express.static(__dirname + '/public'));`)
43
-
- You must use version 1.0.0 or greater of the `browser-sync` package.
41
+
- You must use version 2.0.0 or greater of the `browser-sync` package.
44
42
- Injection only happens on responses with a `Content-Type` header of `text/html` and content containing a closing body tag (`</body>`).
45
43
44
+
## BrowserSync 1.x
45
+
46
+
If you need to use BrowserSync 1.x, use [version 1.0.2](https://github.com/schmich/connect-browser-sync/releases/tag/v1.0.2) of this package.
0 commit comments