File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 1
- /* eslint-disable node/no-extraneous-import */
2
1
import path from 'node:path'
3
2
import { promises as fsp } from 'node:fs'
4
3
import type { Plugin } from 'vite'
@@ -8,15 +7,13 @@ const defaultCacheDir = 'node_modules/.vite'
8
7
function viteBasicSslPlugin ( ) : Plugin {
9
8
return {
10
9
name : 'vite:basic-ssl' ,
11
- async config ( config ) {
10
+ async configResolved ( config ) {
12
11
const certificate = await getCertificate ( ( config . cacheDir ?? defaultCacheDir ) + '/basic-ssl' )
13
12
const https = ( ) => ( {
14
13
https : { cert : certificate , key : certificate }
15
14
} )
16
- return {
17
- server : https ( ) ,
18
- preview : https ( )
19
- }
15
+ config . server . https = Object . assign ( { } , config . server . https , https ( ) )
16
+ config . preview . https = Object . assign ( { } , config . preview . https , https ( ) )
20
17
}
21
18
}
22
19
}
You can’t perform that action at this time.
0 commit comments