sync-php
v1.0.4
Published
a webpack plugin to live reload php server
Downloads
3
Maintainers
Readme
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.js
array
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 above
both 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