React: How to run "response scripts" with a different root?

For special reasons, I want to share the package.json file between two folders web(response app) and mobile:

▸ mobile/
▸ node_modules/
▾ web/public/
  ▸ src/
    README.md
  package-lock.json
  package.json
  yarn.lock

In my package.json file, I added: "web-start": "react-scripts start",scripted. However, when I run it in the root folder ( /Users/edmund/Documents/src/banana-client), I get the following:

➜  banana-client git:(master) ✗ yarn web-start
yarn web-start v0.24.6
$ react-scripts start web
Could not find a required file.
  Name: index.html
  Searched in: /Users/edmund/Documents/src/banana-client/public
error Command failed with exit code 1.

Is there any way to add a root directory?

+4
source share

Source: https://habr.com/ru/post/1679210/


All Articles