This is an example of integration of Webpack with HRM in a PHP application. It supports both regular JS and React.
Clone this repository:
git clone https://github.com/dirkjf/php-webpack-hmr
Install packages:
yarn install
Start a local webserver:
php -S localhost:8000
Start the webpack development server:
yarn start
For production build files instead, run:
yarn build
In your browser go to http://localhost:8000
to see the results.
The Webpack development server will proxy to localhost:8000
(your development address) from localhost:3003
(the address from which assets are server).
You can change these addresses in webpack.config.dev.js.