How to use index.php as the index file with create-react-app

Recently I came across a scenario with a react app, where I had to use index.php as the index file instead of the usual index.html file due to some legacy configuration bootstrapping. Webpack by default, does not understand how to deal with php files and at the same time, did not want to lose the live reload capabilities that comes with webpack.

Let us see how this can be solved.

So we start with creating a react app using create-react-app

create-react-app apache-php-index-demo

--

--

--

Solving Problems. Making Software Better. Intrigued by Elegant Solutions. https://twitter.com/agent_hunt

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Chrome Extension with VueJS

React | How to stop re-rendering in React Components

Framework Vs Library | AngularJS Vs jQuery — All you Need to Know

JavaScript Basic

JavaScriptJavaScript Prototypal Inheritance

Get started, Typescript with Node.js, Express

How to add PineScript code on your TradingView Chart?

Building a Single Song Player

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Shailesh

Shailesh

Solving Problems. Making Software Better. Intrigued by Elegant Solutions. https://twitter.com/agent_hunt

More from Medium

WhereIn Laravel Query with Example -

Multiple Laravel DataTables in one view — as a Service Implementation

WP CLI: Most Useful Commands

WP CLI Usefull Commands

How to create an awesome Github Profile README ?