Skip to content

Commit

Permalink
feat: respect user defined settings (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
digiinsanity authored Jan 10, 2024
1 parent c3b59c2 commit 39abca9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ function viteBasicSslPlugin(): Plugin {
async configResolved(config) {
const certificate = await getCertificate((config.cacheDir ?? defaultCacheDir) + '/basic-ssl')
const https = () => ({ cert: certificate, key: certificate })
config.server.https = Object.assign({}, config.server.https, https())
config.preview.https = Object.assign({}, config.preview.https, https())
if (config.server.https === undefined || !!config.server.https) {
config.server.https = Object.assign({}, config.server.https, https())
}
if (config.preview.https === undefined || !!config.preview.https) {
config.preview.https = Object.assign({}, config.preview.https, https())
}
}
}
}
Expand Down

0 comments on commit 39abca9

Please sign in to comment.