better CLI, more port control. fixes #169

This commit is contained in:
Rich Harris
2018-03-05 13:51:11 -05:00
parent dd6c51567a
commit 5289fc11d8
10 changed files with 178 additions and 120 deletions

View File

@@ -7,6 +7,7 @@ import serialize from 'serialize-javascript';
import escape_html from 'escape-html';
import { lookup } from './mime';
import { create_routes, templates, create_compilers } from 'sapper/core.js';
import { exists } from '../utils';
import { dest, dev } from '../config';
import { Route, Template } from '../interfaces';
import sourceMapSupport from 'source-map-support';
@@ -336,13 +337,4 @@ function try_serialize(data: any) {
} catch (err) {
return null;
}
}
function exists(file: string) {
try {
fs.statSync(file);
return true;
} catch (err) {
return false;
}
}