1.0.4 • Published 5 years ago
sync-php v1.0.4
this is a webpack plugin that you can use to reload php files on changes.
Installation
step 1
add plugin to the
webapck.dev.config.jsarray
const syncPhp = require('sync-php');
plugins: [
new syncPhp({
port: 1337, // required
watch: path.resolve('build/') // required
})
]there are two options
port
use the port seprate from all the other ports
watch
directory you want to wath changes
step 2
add loader to your main.js file at the end
require('sync-php/client.js')(1337)
// this is the same port mentioned aboveboth ports should be same
step 3
run wepack server in watch mode or run dev server
open your php file into browser
for php server use following command
php -S localhost:9000