Last active
October 29, 2021 18:56
-
-
Save Whitecx/7d6994aacdef751d94c5603a9b630d56 to your computer and use it in GitHub Desktop.
An NPM script for starting both the main server with npm start, and a react local server with npm start in separate windows. (Assumes folder structure: root->client, server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"scripts":{ | |
"predualStart": "echo \"DIR=\"$0\"; cd \"$DIR\"; echo \"Launching React Client in New Window\"; echo \"Current directory: \"$PWD\"\"; npm --prefix \"$PWD\"/../client start;\" > clientStarter.sh && chmod +x clientStarter.sh && open -a Terminal clientStarter.sh", | |
"dualStart": "trap 'rm clientStarter.sh' SIGINT && nodemon --inspect -r dotenv/config -i index.js", | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment