Skip to content

Commit

Permalink
[0.8.x] Respect vite server.origin in viteDevServerUrl (#255)
Browse files Browse the repository at this point in the history
* respect vite server.origin in viteDevServerUrl

* optional chaining for potential missing server config

* fix type error

* pull from userConfig not resolvedConfig
  • Loading branch information
nurdism authored Dec 14, 2023
1 parent 7abca67 commit 0344788
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function resolveLaravelPlugin(pluginConfig: Required<PluginConfig>): LaravelPlug

const isAddressInfo = (x: string|AddressInfo|null|undefined): x is AddressInfo => typeof x === 'object'
if (isAddressInfo(address)) {
viteDevServerUrl = resolveDevServerUrl(address, server.config, userConfig)
viteDevServerUrl = userConfig.server?.origin ? userConfig.server.origin as DevServerUrl : resolveDevServerUrl(address, server.config, userConfig)
fs.writeFileSync(pluginConfig.hotFile, viteDevServerUrl)

setTimeout(() => {
Expand Down

0 comments on commit 0344788

Please sign in to comment.