Add liveServer

This commit is contained in:
Tom Raithel
2017-02-10 20:00:37 +01:00
parent d331e97ba8
commit 70ce2feefb
2 changed files with 8 additions and 1 deletions

View File

@@ -24,6 +24,7 @@
"babel-preset-stage-0": "6.22.0", "babel-preset-stage-0": "6.22.0",
"front-matter": "2.1.2", "front-matter": "2.1.2",
"fs-extra": "2.0.0", "fs-extra": "2.0.0",
"live-server": "1.2.0",
"marked": "0.3.6", "marked": "0.3.6",
"postcss-cli": "2.6.0", "postcss-cli": "2.6.0",
"postcss-easy-import": "2.0.0", "postcss-easy-import": "2.0.0",

View File

@@ -1,5 +1,6 @@
import { watch } from 'fs'; import { watch } from 'fs';
import { exec } from 'child_process'; import { exec } from 'child_process';
import liveServer from 'live-server';
import { import {
stylesPath, stylesPath,
@@ -8,6 +9,7 @@ import {
radarPath, radarPath,
staticPath, staticPath,
templatesPath, templatesPath,
distPath,
} from './file'; } from './file';
const watchBuild = (name) => (eventType, fileName) => { const watchBuild = (name) => (eventType, fileName) => {
@@ -32,4 +34,8 @@ watch(radarPath(), options, watchBuild('pages'));
watch(staticPath(), options, watchBuild('pages')); watch(staticPath(), options, watchBuild('pages'));
watch(templatesPath(), options, watchBuild('pages')); watch(templatesPath(), options, watchBuild('pages'));
console.log('Watching for changes, press CTRL+C to quit'); var params = {
root: distPath(),
logLevel: 2, // 0 = errors only, 1 = some, 2 = lots
};
liveServer.start(params);