We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2d498c commit 8df71dbCopy full SHA for 8df71db
src/index.ts
@@ -1,4 +1,3 @@
1
-/* eslint-disable node/no-extraneous-import */
2
import path from 'node:path'
3
import { promises as fsp } from 'node:fs'
4
import type { Plugin } from 'vite'
@@ -8,15 +7,13 @@ const defaultCacheDir = 'node_modules/.vite'
8
7
function viteBasicSslPlugin(): Plugin {
9
return {
10
name: 'vite:basic-ssl',
11
- async config(config) {
+ async configResolved(config) {
12
const certificate = await getCertificate((config.cacheDir ?? defaultCacheDir) + '/basic-ssl')
13
const https = () => ({
14
https: { cert: certificate, key: certificate }
15
})
16
- return {
17
- server: https(),
18
- preview: https()
19
- }
+ config.server.https = Object.assign({}, config.server.https, https())
+ config.preview.https = Object.assign({}, config.preview.https, https())
20
}
21
22
0 commit comments