Skip to content

Commit 7d78e41

Browse files
committed
Fixed default mode in configureServer
1 parent 89d74e4 commit 7d78e41

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ function resolveLaravelPlugin(pluginConfig: Required<PluginConfig>): LaravelPlug
9999
const assetUrl = env.ASSET_URL ?? ''
100100

101101
return {
102+
mode: mode,
102103
base: command === 'build' ? resolveBase(pluginConfig, assetUrl) : '',
103104
publicDir: false,
104105
build: {
@@ -147,7 +148,7 @@ function resolveLaravelPlugin(pluginConfig: Required<PluginConfig>): LaravelPlug
147148
const hotFile = path.join(pluginConfig.publicDirectory, 'hot')
148149

149150
const envDir = resolvedConfig.envDir || process.cwd()
150-
const appUrl = loadEnv('', envDir, 'APP_URL').APP_URL
151+
const appUrl = loadEnv(resolvedConfig.mode, envDir, 'APP_URL').APP_URL
151152

152153
server.httpServer?.once('listening', () => {
153154
const address = server.httpServer?.address()
@@ -341,7 +342,7 @@ function resolveDevServerUrl(address: AddressInfo, config: ResolvedConfig): DevS
341342
const configHost = typeof config.server.host === 'string' ? config.server.host : null
342343
const serverAddress = isIpv6(address) ? `[${address.address}]` : address.address
343344
const host = configHmrHost ?? configHost ?? serverAddress
344-
345+
345346
const configHmrClientPort = typeof config.server.hmr === 'object' ? config.server.hmr.clientPort : null
346347
const port = configHmrClientPort ?? address.port
347348

0 commit comments

Comments
 (0)