0

I have a react project inside of a folder and I want react-scripts to target and compile from a folder. It looks like this

project
│   README.md
│   package.json   
│
└───react
│   │   jsconfig.json
│   │
│   └───src
│   │
│   └───public
│   
└───api
    │   tsconfig.json
    │
    └───src

from the project/package.json I want to run react-scripts start and have it compile the /react folder. How can I do this?

svnty
  • 19
  • 1
  • 7

1 Answers1

0

I solved the issue with the use off react-app-rewired

See this stackoverflow post on details of how it was done.

const path = require('path');

module.exports = {
  paths: function (paths, env) {
    paths.appIndexJs = path.resolve(__dirname, 'react/src/index.js');
    paths.appSrc = path.resolve(__dirname, 'react/src');
    paths.appPublic = path.resolve(__dirname, 'react/public');
    paths.appHtml = path.resolve(__dirname, 'react/public/index.html');
    return paths;
  }
}
svnty
  • 19
  • 1
  • 7