Skip to content

Commit 39abca9

Browse files
authored
feat: respect user defined settings (#16)
1 parent c3b59c2 commit 39abca9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/index.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,12 @@ function viteBasicSslPlugin(): Plugin {
1010
async configResolved(config) {
1111
const certificate = await getCertificate((config.cacheDir ?? defaultCacheDir) + '/basic-ssl')
1212
const https = () => ({ cert: certificate, key: certificate })
13-
config.server.https = Object.assign({}, config.server.https, https())
14-
config.preview.https = Object.assign({}, config.preview.https, https())
13+
if (config.server.https === undefined || !!config.server.https) {
14+
config.server.https = Object.assign({}, config.server.https, https())
15+
}
16+
if (config.preview.https === undefined || !!config.preview.https) {
17+
config.preview.https = Object.assign({}, config.preview.https, https())
18+
}
1519
}
1620
}
1721
}

0 commit comments

Comments
 (0)