diff --git a/package.json b/package.json index 82806da..d455afa 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "build": "tsc && vite build", "serve": "vite preview", "start": "node start.js", - "stop": "pkill -f node", + "stop": "pkill -f 'vite preview'", "html": "html-minifier --remove-comments --collapse-whitespace --input-dir ./dist --output-dir ./dist --file-ext html", "replace": "npm run replace:script", "replace:script": "replace-in-file --configFile replace-script.cjs" diff --git a/start.js b/start.js index 22674c5..fa6c637 100644 --- a/start.js +++ b/start.js @@ -48,7 +48,11 @@ async function runCommands() { await renderHomePage(); await runNpmCommand("run html"); await runNpmCommand("run replace"); - await runNpmCommand("run stop"); + try { + await runNpmCommand("run stop"); + } catch { + // It's fine + } }, 2000); console.log("Starting web server");