File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed
Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change 1- /* eslint-disable node/no-extraneous-import */
21import path from 'node:path'
32import { promises as fsp } from 'node:fs'
43import type { Plugin } from 'vite'
@@ -8,15 +7,13 @@ const defaultCacheDir = 'node_modules/.vite'
87function viteBasicSslPlugin ( ) : Plugin {
98 return {
109 name : 'vite:basic-ssl' ,
11- async config ( config ) {
10+ async configResolved ( config ) {
1211 const certificate = await getCertificate ( ( config . cacheDir ?? defaultCacheDir ) + '/basic-ssl' )
1312 const https = ( ) => ( {
1413 https : { cert : certificate , key : certificate }
1514 } )
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 ( ) )
2017 }
2118 }
2219}
You can’t perform that action at this time.
0 commit comments