-
Notifications
You must be signed in to change notification settings - Fork 0
/
.browsersync.js
45 lines (43 loc) · 1.07 KB
/
.browsersync.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
|--------------------------------------------------------------------------
| Browser-sync config file
|--------------------------------------------------------------------------
|
| For up-to-date information about the options:
| http://www.browsersync.io/docs/options/
*/
const path = require("path");
const packageJson = require(path.resolve(process.cwd(), "package.json"));
module.exports = {
port: 3322,
ui: {
port: 3323,
},
server: {
directory: false,
},
files: ["index.*", "modules/**/*", "../shared/**/*"],
ignore: ["./__services/**/*", "./server/**/*"],
injectChanges: false,
notify: false,
middleware: [
function (req, res, next) {
// if (req.url === "/") {
// res.writeHead(302, { Location: `/` });
// res.end();
// return;
// }
next();
},
],
snippetOptions: {
ignorePaths: ["index.bootstrap.html"],
rule: {
match: /<\/body>/i,
fn: function (snippet, match) {
const customSnippet = `<script async src='/browser-sync/browser-sync-client.js?v=2.26.7'><\/script>\n`;
return customSnippet + match;
},
},
},
};