@@ -299,7 +299,9 @@ function generate_vercel_config(options) {
299299 * @returns {Promise<void> }
300300 */
301301export async function adapt ( options = { } ) {
302- const { outDir = 'dist' , serverless = { } , isr = false } = options ;
302+ const { outDir = 'dist' , serverless = { } , isr = false , verbose = true } = options ;
303+
304+ const log = verbose ? console . log . bind ( console ) : ( ) => { } ;
303305
304306 const project_root = process . cwd ( ) ;
305307 const build_dir = resolve ( project_root , outDir ) ;
@@ -330,7 +332,7 @@ export async function adapt(options = {}) {
330332 // Clean and create output directory
331333 // ------------------------------------------------------------------
332334
333- console . log ( '[adapter-vercel] Generating Vercel Build Output...' ) ;
335+ log ( '[adapter-vercel] Generating Vercel Build Output...' ) ;
334336
335337 rmSync ( output_dir , { recursive : true , force : true } ) ;
336338 mkdirSync ( output_dir , { recursive : true } ) ;
@@ -341,7 +343,7 @@ export async function adapt(options = {}) {
341343
342344 const static_dir = join ( output_dir , 'static' ) ;
343345
344- console . log ( '[adapter-vercel] Copying static assets...' ) ;
346+ log ( '[adapter-vercel] Copying static assets...' ) ;
345347 copy_dir ( client_dir , static_dir ) ;
346348
347349 // Remove index.html from static output — SSR handles the root route.
@@ -359,7 +361,7 @@ export async function adapt(options = {}) {
359361 const func_dir = join ( output_dir , 'functions' , 'index.func' ) ;
360362 mkdirSync ( func_dir , { recursive : true } ) ;
361363
362- console . log ( '[adapter-vercel] Tracing server dependencies...' ) ;
364+ log ( '[adapter-vercel] Tracing server dependencies...' ) ;
363365
364366 // Trace and copy all dependencies of the server entry.
365367 // The trace result tells us the project-relative path where the entry
@@ -420,7 +422,7 @@ export async function adapt(options = {}) {
420422
421423 vc_config . prerender = prerender ;
422424
423- console . log (
425+ log (
424426 `[adapter-vercel] ISR enabled (expiration: ${ isr . expiration === false ? 'never' : isr . expiration + 's' } )` ,
425427 ) ;
426428 }
@@ -431,7 +433,7 @@ export async function adapt(options = {}) {
431433 // 3. Generate the Build Output API config
432434 // ------------------------------------------------------------------
433435
434- console . log ( '[adapter-vercel] Writing config...' ) ;
436+ log ( '[adapter-vercel] Writing config...' ) ;
435437
436438 const vercel_config = generate_vercel_config ( options ) ;
437439 write ( join ( output_dir , 'config.json' ) , JSON . stringify ( vercel_config , null , '\t' ) ) ;
@@ -440,8 +442,8 @@ export async function adapt(options = {}) {
440442 // Summary
441443 // ------------------------------------------------------------------
442444
443- console . log ( '[adapter-vercel] Build output generated at .vercel/output/' ) ;
444- console . log ( ` Static: ${ static_dir } ` ) ;
445- console . log ( ` Function: ${ func_dir } ` ) ;
446- console . log ( ` Runtime: ${ runtime } ` ) ;
445+ log ( '[adapter-vercel] Build output generated at .vercel/output/' ) ;
446+ log ( ` Static: ${ static_dir } ` ) ;
447+ log ( ` Function: ${ func_dir } ` ) ;
448+ log ( ` Runtime: ${ runtime } ` ) ;
447449}
0 commit comments