Skip to content

Commit

Permalink
ops: Updated browser-sync
Browse files Browse the repository at this point in the history
It ended up being a thing: BrowserSync/browser-sync#1978
  • Loading branch information
the0neWhoKnocks committed Dec 21, 2022
1 parent 47a4111 commit 0c74ef9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
5 changes: 4 additions & 1 deletion scaffold.js
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ async function scaffold() {
packageJSON.devDependencies['nodemon'] = '2.0.15';
}

if (addClient) packageJSON.devDependencies['browser-sync'] = '2.27.7';
if (addClient) packageJSON.devDependencies['browser-sync'] = '2.27.11';

addParsedFiles([{
executable: true,
Expand All @@ -698,6 +698,7 @@ async function scaffold() {
{ token: 'WATCHER__CLIENT', remove: !addClient },
{ token: 'WATCHER__LOGGER', remove: !logger },
{ token: 'WATCHER__SERVER', remove: !addServer },
{ token: 'WATCHER__WEB_SOCKET', remove: !webSocket },
],
}]);
}
Expand Down Expand Up @@ -847,6 +848,7 @@ async function scaffold() {
to: '',
tokens: [
{ token: 'DC__APP_NAME', replacement: kebabAppName },
{ token: 'DC__BSYNC', remove: !(hasWatcher && addClient) },
{ token: 'DC__DEV_APP_NAME', replacement: kebabAppNameDev },
{ token: 'DC__E2E', remove: !e2eTests },
{ token: 'DC__MULTI_USER', remove: !multiUser },
Expand All @@ -856,6 +858,7 @@ async function scaffold() {
{ token: 'DC__VHOST', remove: !vHost },
{ token: 'DC__VHOST_NON_SECURE', remove: secure },
{ token: 'DC__VHOST_SECURE', remove: !secure },
{ token: 'DC__WEB_SOCKET', remove: !webSocket },
],
},
];
Expand Down
3 changes: 3 additions & 0 deletions static/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ services:
# browserSync
- "3001:3001"
- "3002:3002"
#TOKEN:^DC__WEB_SOCKET
- "3003:3003"
#TOKEN:$DC__WEB_SOCKET
#TOKEN:$DC__BSYNC
# inspector
- "9229:9229"
Expand Down
12 changes: 11 additions & 1 deletion static/node/watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,25 @@ fileGate
port: SERVER__PORT + 1,
proxy: {
target: `${protocol}://localhost:${SERVER__PORT}`,
//TOKEN:^WATCHER__WEB_SOCKET
ws: true,
//TOKEN:$WATCHER__WEB_SOCKET
},
reloadDebounce: 300, // Wait for a specified window of event-silence before sending any reload events.
reloadDebounce: 1000, // Wait for a specified window of event-silence before sending any reload events.
serveStatic: ['dist/public'], // now required when using `proxy` otherwise automatic-reloads don't work.
snippetOptions: {
async: true,
rule: {
match: /<\/body>/i,
fn: (snippet) => snippet,
},
},
//TOKEN:^WATCHER__WEB_SOCKET
socket: {
domain: `localhost:${SERVER__PORT + 3}`,
port: SERVER__PORT + 3,
},
//TOKEN:$WATCHER__WEB_SOCKET
ui: {
port: SERVER__PORT + 2,
},
Expand Down

0 comments on commit 0c74ef9

Please sign in to comment.