From 943a1ed5e607edb8a4d1538457f010cc033c0209 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 17 Dec 2018 22:42:39 -0800 Subject: [PATCH] chore: fix build process in dev mode (#835) --- bin/build-template-html.js | 3 ++- package.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/build-template-html.js b/bin/build-template-html.js index 8d3e0dd..afe7523 100644 --- a/bin/build-template-html.js +++ b/bin/build-template-html.js @@ -94,9 +94,10 @@ async function buildAll () { } async function main () { - await buildAll() if (process.argv.includes('--watch')) { doWatch() + } else { + await buildAll() } } diff --git a/package.json b/package.json index 2681227..8592b1e 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "scripts": { "lint": "standard && standard --plugin html 'src/routes/**/*.html'", "lint-fix": "standard --fix && standard --fix --plugin html 'src/routes/**/*.html'", - "dev": "run-p --race build-template-html-watch sapper-dev", + "dev": "run-s build-template-html serve-dev", + "serve-dev": "run-p --race build-template-html-watch sapper-dev", "sapper-dev": "cross-env NODE_ENV=development PORT=4002 sapper dev", "sapper-prod": "cross-env PORT=4002 node __sapper__/build", "build": "cross-env NODE_ENV=production npm run build-steps",