[Vuejs]-Start client and server in one command using Vue-cli / Webpack

0๐Ÿ‘

I was able to get this working with the following bash script:

#!/usr/bin/env bash

node server/server.js &
pid=$!

yarn dev --open

trap "kill ${pid}; exit 1" INT

This script is a little bit more complex than you might expect to make sure that all child processes stop when this script stops (using ctrl-C). For more information on stopping child processes I found some help here: how-can-bash-script-do-the-equivalent-of-ctrl-c-to-a-background-task

๐Ÿ‘คHendrik Jan

Leave a comment