This commit is contained in:
Rich Harris
2018-01-21 14:41:11 -05:00
parent 7d721abb2a
commit dd8deb2d8a
24 changed files with 166 additions and 128 deletions

View File

@@ -1,10 +1,11 @@
import { build, export as exporter } from 'sapper/core.js';
import { dest, dev, entry, src } from '../config.js';
const cmd = process.argv[2];
const start = Date.now();
if (cmd === 'build') {
build()
build({ dest, dev, entry, src })
.then(() => {
const elapsed = Date.now() - start;
console.error(`built in ${elapsed}ms`); // TODO beautify this, e.g. 'built in 4.7 seconds'
@@ -15,8 +16,8 @@ if (cmd === 'build') {
} else if (cmd === 'export') {
const start = Date.now();
build()
.then(() => exporter())
build({ dest, dev, entry, src })
.then(() => exporter({ src, dest }))
.then(() => {
const elapsed = Date.now() - start;
console.error(`extracted in ${elapsed}ms`); // TODO beautify this, e.g. 'built in 4.7 seconds'