I pulled down this starter kit for Laravel/React project I'm playing about with. I'm finding that hot reloading doesn't work like it does with Vue.js. This is my script (I'm running npm run hot
)
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"analyze": "source-map-explorer 'public/js/*.js'"
},
And this is my webpack:
let mix = require('laravel-mix');
require('laravel-mix-tailwind');
require('laravel-mix-purgecss');
mix.react('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css')
.purgeCss()
.tailwind('tailwind.config.js')
.webpackConfig({
externals: [
'child_process'
],
node: {
fs: 'empty'
}
}).sourceMaps();
What do I need to add to my webpack so make is so that saving my React files automatically update the page as I'm looking at it? I've tried various different solutions but nothing is working.
Surely it is possible?