File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ type PluginOptions = {
1919 * @returns a Vite plugin
2020 */
2121export default function DevcertPlugin ( options : PluginOptions = { } ) : Plugin {
22+ let didShowInfo = false ;
23+
2224 return {
2325 name : '@idleberg/vite-plugin-devcert' ,
2426 config : async ( userConfig : UserConfig , { command } ) => {
@@ -36,16 +38,20 @@ export default function DevcertPlugin(options: PluginOptions = {}): Plugin {
3638
3739 const domain = server ?. host && typeof server . host === 'string' ? server . host : 'localhost' ;
3840
39- console . info (
40- box (
41- // Keep lines short for better readability
42- [
43- `Generating a certificate for "${ cyan ( domain ) } ".` ,
44- 'You may be prompted to enter your password to allow the creation of a root certificate authority.' ,
45- `\n\nFor details, please refer to the Expo documentation at ${ underline ( 'https://github.com/expo/devcert#how-it-works' ) } .` ,
46- ] . join ( ' ' ) ,
47- ) ,
48- ) ;
41+ if ( ! didShowInfo ) {
42+ console . info (
43+ box (
44+ // Keep lines short for better readability
45+ [
46+ `Generating a certificate for "${ cyan ( domain ) } ".` ,
47+ 'You may be prompted to enter your password to allow the creation of a root certificate authority.' ,
48+ `\n\nFor details, please refer to the Expo documentation at ${ underline ( 'https://github.com/expo/devcert#how-it-works' ) } .` ,
49+ ] . join ( ' ' ) ,
50+ ) ,
51+ ) ;
52+
53+ didShowInfo = true ;
54+ }
4955
5056 const { key, cert } = await certificateFor ( domain , options ) ;
5157
You can’t perform that action at this time.
0 commit comments