How can I set up React in CakePHP webroot using webpack?
I have an existing CakePHP project (with Model, View, Controller). I want to set mini React project in its webroot (Project/Miniproject/index.html). index.html will make ajax calls to api's defined in controllers.
- Project
| - app
| | - Controller
| | - View
| | - Model
| | - webroot
| | | - Miniproject
| | | | - index.html [Mini react project]
I have tried installing React Transform Boilerplate. But it use web dev server (and renders files on localhost:3000). But I want files rendered from the nginx server on which my CakePHP project runs.
When I visit the url (Project/Miniproject/index.html), it cannot find dist/bundle.js because it is in memory. So how can I set up React in CakePHP webroot using webpack?
npm run build