I'm creating a rails application from scratch using the following blog which needs me to run rails s
and then yarn start
in the /client
folder of the application (where all the JS and React components will live).
The /client/package.json
file has some scripts configured to run a server that detects changes in my react components and reloads the components automatically:
client/package.json:
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-scripts": "3.0.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"proxy": "http://localhost:3001"
}
I use a program called hivemind which is a Procfile
manager and I would like both the rails server process and the yarn process to run together in the same terminal.
I'd like to do something like this in my Profile
:
server: bin/rails server
react: yarn start
The problem is that Profile
lives in the root of my application and I have to change directory into client
and then run yarn start
.
TL;DR:
Is there an option with yarn run
that you can tell it to run from another folder or read a package.json
file in another folder and have it run the script in that file?