Skip to content

Commit a870584

Browse files
authored
fix: --https get ignored in preview (#4318)
1 parent 3a97644 commit a870584

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

packages/vite/src/node/cli.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,8 @@ cli
211211
logLevel: options.logLevel,
212212
server: {
213213
open: options.open,
214-
strictPort: options.strictPort
214+
strictPort: options.strictPort,
215+
https: options.https
215216
}
216217
},
217218
'serve',
@@ -222,7 +223,6 @@ cli
222223
cleanOptions(options) as {
223224
host?: string
224225
port?: number
225-
https?: boolean
226226
}
227227
)
228228
} catch (e) {

packages/vite/src/node/preview.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@ import { resolveHostname } from './utils'
1818

1919
export async function preview(
2020
config: ResolvedConfig,
21-
serverOptions: { host?: string; port?: number; https?: boolean }
21+
serverOptions: { host?: string; port?: number }
2222
): Promise<void> {
2323
const app = connect() as Connect.Server
2424
const httpServer = await resolveHttpServer(
2525
config.server,
2626
app,
27-
serverOptions.https === false ? undefined : await resolveHttpsConfig(config)
27+
await resolveHttpsConfig(config)
2828
)
2929

3030
// cors

0 commit comments

Comments
 (0)