vite-plugin-phpsandbox 0.4.0 → 0.4.1

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/README.md CHANGED
@@ -49,6 +49,8 @@ The plugin reads these environment variables by default:
49
49
 
50
50
  When `PHPSANDBOX_TYPE=laravel`, the plugin does not create a standalone HMR server. It sets `server.port` to the resolved HMR port and configures the advertised HMR endpoint instead.
51
51
 
52
+ When a public host is available, Laravel mode also defaults `server.origin` to its HTTPS URL so development assets use the public proxy rather than localhost. An explicitly configured origin is preserved. Other sandbox types retain their existing asset origin because their standalone server handles HMR only.
53
+
52
54
  ## API
53
55
 
54
56
  ```ts
package/dist/index.cjs CHANGED
@@ -166,6 +166,7 @@ function resolveServerConfig(existingServer, env, isLaravel, publicHost, hmrServ
166
166
  ...existingServer,
167
167
  host: existingServer.host ?? true,
168
168
  ...isLaravel ? { port: hmrPort } : {},
169
+ ...isLaravel && publicHost ? { origin: existingServer.origin ?? `https://${publicHost}` } : {},
169
170
  hmr: resolveHmrOptions(existingServer, publicHost, hmrServer, hmrPort),
170
171
  allowedHosts: resolveAllowedHosts(
171
172
  existingServer.allowedHosts,
package/dist/index.js CHANGED
@@ -130,6 +130,7 @@ function resolveServerConfig(existingServer, env, isLaravel, publicHost, hmrServ
130
130
  ...existingServer,
131
131
  host: existingServer.host ?? true,
132
132
  ...isLaravel ? { port: hmrPort } : {},
133
+ ...isLaravel && publicHost ? { origin: existingServer.origin ?? `https://${publicHost}` } : {},
133
134
  hmr: resolveHmrOptions(existingServer, publicHost, hmrServer, hmrPort),
134
135
  allowedHosts: resolveAllowedHosts(
135
136
  existingServer.allowedHosts,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-phpsandbox",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Vite plugin for PHP sandbox environments that need stable HMR over public proxy hosts.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -36,7 +36,8 @@
36
36
  "scripts": {
37
37
  "build": "tsup src/index.ts --format esm,cjs --dts",
38
38
  "check": "tsc --noEmit",
39
- "release:check": "npm run check && npm run build && npm pack --dry-run",
39
+ "test": "npm run build && node --test tests/*.test.mjs",
40
+ "release:check": "npm run check && npm run test && npm pack --dry-run",
40
41
  "release": "npm version minor && npm run release:check && npm publish",
41
42
  "prepublishOnly": "npm run build && npm run check"
42
43
  },