Skip to content

Commit

Permalink
fix: https object config error (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
hugoattal authored Dec 9, 2022
1 parent bd75e51 commit 722e050
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ function viteBasicSslPlugin(): Plugin {
name: 'vite:basic-ssl',
async configResolved(config) {
const certificate = await getCertificate((config.cacheDir ?? defaultCacheDir) + '/basic-ssl')
const https = () => ({
https: { cert: certificate, key: certificate }
})
const https = () => ({ cert: certificate, key: certificate })
config.server.https = Object.assign({}, config.server.https, https())
config.preview.https = Object.assign({}, config.preview.https, https())
}
Expand Down Expand Up @@ -41,5 +39,5 @@ export async function getCertificate(cacheDir: string) {
return content
}
}

export default viteBasicSslPlugin

0 comments on commit 722e050

Please sign in to comment.