I have built an app using Vue.js and express.js. Currently I have to open two terminal windows and run npm run serve
in one and npm start
in the other. I want to make the server run after the Vue.js app builds in the same terminal. I read on this article that I can get both scripts to run by chaining the two package.json
scripts together, but for the life of me can't figure out how. My project is structured as such:
├── project
├── _frontend
| ├── package.json
├── backend
| ├── package.json
I have tried the following ways:
1st try - "serve": "vue-cli-service serve && (cd ../server && npm start)"
2nd try - "serve": "vue-cli-service serve && (cd ../server && npm run start)"
3rd try - "serve": "vue-cli-service serve && (cd ../server) && npm start"
The Vue.js app builds and runs just fine but the server does not start. I tried doing the reverse on the server package.json
as well and the server starts but the app does not build. Is this something I can not accomplish due to the folder setup or what am I doing wrong?