Skip to content

Commit a522ba4

Browse files
committed
(flavor) fancy-templated-site v3.0.0
1 parent 839e7af commit a522ba4

File tree

20 files changed

+186
-3
lines changed

20 files changed

+186
-3
lines changed

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.min.js
2+
*.build.js

lib/extensions/browser-sync.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
'use strict';
2+
3+
const ChildProcess = require('child_process');
4+
const Util = require('util');
5+
6+
module.exports = [
7+
{
8+
type: 'onPostStart',
9+
method: async (server) => {
10+
11+
if (!server.realm.pluginOptions.developmentMode) {
12+
return;
13+
}
14+
15+
const bs = server.app.bs = require('browser-sync').create();
16+
const base = server.realm.settings.files.relativeTo;
17+
const run = (cmd) => ChildProcess.spawn('npm', ['run', cmd], { stdio: 'inherit' });
18+
19+
bs.watch(`${base}/public/**/*.scss`).on('change', () => run('prebuild:css'));
20+
bs.watch([`${base}/public/**/*.js`, '!**/*.build.*']).on('change', () => run('prebuild:js'));
21+
22+
bs.watch(`${base}/templates/**/*`).on('change', bs.reload);
23+
bs.watch(`${base}/public/**/*.{build.js,css}`).on('change', bs.reload);
24+
25+
await Util.promisify(bs.init)({ proxy: server.info.uri });
26+
}
27+
},
28+
{
29+
type: 'onPreStop',
30+
method: (server) => {
31+
32+
if (!server.app.bs) {
33+
return;
34+
}
35+
36+
server.app.bs.exit();
37+
}
38+
}
39+
];

lib/path.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict';
2+
3+
module.exports = __dirname;

lib/plugins/@hapi.inert.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict';
2+
3+
module.exports = {};

lib/plugins/@hapi.vision.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict';
2+
3+
module.exports = {};

lib/public/css/main.build.css

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/public/css/main.build.css.map

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/public/css/main.build.min.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
body{background-color:#000;color:#fff}

lib/public/css/main.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
body {
2+
color: white;
3+
background-color: black;
4+
}

lib/public/js/main.build.js

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)