vite-plugin-php 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -53,12 +53,13 @@ function unescapePHP(file, tokensFile) {
|
|
|
53
53
|
|
|
54
54
|
function start(root) {
|
|
55
55
|
if (!globalThis.php?.pid) {
|
|
56
|
+
const routerFileUrl = new URL("./router.php", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (document.currentScript && document.currentScript.src || new URL('index.cjs', document.baseURI).href)));
|
|
56
57
|
globalThis.php = child_process.spawn(phpServer.binary, [
|
|
57
58
|
"-S",
|
|
58
59
|
"localhost:" + phpServer.port,
|
|
59
60
|
"-t",
|
|
60
61
|
root,
|
|
61
|
-
|
|
62
|
+
decodeURI(routerFileUrl.pathname)
|
|
62
63
|
]).once("spawn", () => {
|
|
63
64
|
console.log(
|
|
64
65
|
`PHP development server started (PID: ${globalThis.php?.pid})`
|
package/dist/index.mjs
CHANGED
|
@@ -47,12 +47,13 @@ function unescapePHP(file, tokensFile) {
|
|
|
47
47
|
|
|
48
48
|
function start(root) {
|
|
49
49
|
if (!globalThis.php?.pid) {
|
|
50
|
+
const routerFileUrl = new URL("./router.php", import.meta.url);
|
|
50
51
|
globalThis.php = spawn(phpServer.binary, [
|
|
51
52
|
"-S",
|
|
52
53
|
"localhost:" + phpServer.port,
|
|
53
54
|
"-t",
|
|
54
55
|
root,
|
|
55
|
-
|
|
56
|
+
decodeURI(routerFileUrl.pathname)
|
|
56
57
|
]).once("spawn", () => {
|
|
57
58
|
console.log(
|
|
58
59
|
`PHP development server started (PID: ${globalThis.php?.pid})`
|