-
-
Notifications
You must be signed in to change notification settings - Fork 115
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Concurrently and Browsersync for live reload (#21)
* Add Concurrently and BrowserSync for live reload * Add yarn install step to bridgtown new * Add documentation and script config options * Update scripts in new site template
- Loading branch information
1 parent
9423c8e
commit ec90abf
Showing
26 changed files
with
1,210 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
*.md | ||
*.html | ||
*.js | ||
*.liquid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const concurrently = require('concurrently'); | ||
|
||
// By default, configure Bridgetown to use port 4001 so Browsersync can use 4000 | ||
// See also Browsersync settings in sync.js | ||
const port = 4001 | ||
|
||
///////////////// | ||
// Concurrently | ||
///////////////// | ||
concurrently([ | ||
{ command: "yarn webpack-dev", name: "Webpack", prefixColor: "yellow"}, | ||
{ command: "sleep 4; yarn serve --port " + port, name: "Bridgetown", prefixColor: "green"}, | ||
{ command: "sleep 8; yarn sync", name: "Live", prefixColor: "blue"} | ||
], { | ||
restartTries: 3, | ||
killOthers: ['failure', 'success'], | ||
}).then(() => {}, () => {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
const browserSync = require("browser-sync").create(); | ||
|
||
// You can change these configuration values: | ||
const proxy = "http://localhost:4001" | ||
const port = 4000 | ||
const uiPort = 4002 | ||
|
||
//////////////// | ||
// Browsersync | ||
//////////////// | ||
browserSync.init({ | ||
open: false, | ||
notify: false, | ||
proxy: proxy, | ||
port: port, | ||
files: "output/index.html", | ||
ghostMode: { | ||
clicks: false, | ||
forms: false, | ||
scroll: false, | ||
}, | ||
reloadDelay: 0, | ||
injectChanges: false, | ||
ui: { | ||
port: uiPort | ||
}, | ||
snippetOptions: { | ||
rule: { | ||
match: /<\/head>/i, | ||
fn: function (snippet, match) { | ||
return snippet + match; | ||
}, | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#! /usr/bin/env bash | ||
|
||
set -e | ||
|
||
# Copy files from the website to update the CLI site template | ||
cp ../bridgetown-website/start.js ../bridgetown-website/sync.js ../bridgetown-website/webpack.config.js lib/site_template | ||
cat ../bridgetown-website/package.json | sed 's/bridgetown-website/new-bridgetown-site/' > lib/site_template/package.json | ||
echo "$0: Done!" | ||
echo "$0: ***Don't forget to strip out extra Yarn dependencies in package.json!!!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
bridgetown-website/src/_components/docs/install/concurrently.liquid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{% rendercontent "docs/note" title: "Top Top: Adding Concurrently Processes" %} | ||
Want to run even more background processes or change up your build tools? Take a look | ||
at the provided `sync.js` script and read up on the | ||
[Concurrently](https://github.com/kimmobrunfeldt/concurrently#readme) documentation to | ||
see which options are available. | ||
{% endrendercontent %} |
5 changes: 4 additions & 1 deletion
5
bridgetown-website/src/_components/docs/install/node_on_linux.liquid
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
bridgetown-website/src/_components/docs/install/webpack_watch.liquid
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.