File tree Expand file tree Collapse file tree 3 files changed +12
-6
lines changed
test/integration/custom-routes/test Expand file tree Collapse file tree 3 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -102,7 +102,8 @@ export type PrerenderManifest = {
102102export default async function build (
103103 dir : string ,
104104 conf = null ,
105- reactProductionProfiling = false
105+ reactProductionProfiling = false ,
106+ debugOutput = false
106107) : Promise < void > {
107108 if ( ! ( await isWriteable ( dir ) ) ) {
108109 throw new Error (
@@ -1024,7 +1025,10 @@ export default async function build(
10241025 isModern : config . experimental . modern ,
10251026 }
10261027 )
1027- printCustomRoutes ( { redirects, rewrites, headers } )
1028+
1029+ if ( debugOutput ) {
1030+ printCustomRoutes ( { redirects, rewrites, headers } )
1031+ }
10281032
10291033 if ( tracer ) {
10301034 const parsedResults = await tracer . profiler . stopProfiling ( )
Original file line number Diff line number Diff line change @@ -12,8 +12,10 @@ const nextBuild: cliCommand = (argv) => {
1212 // Types
1313 '--help' : Boolean ,
1414 '--profile' : Boolean ,
15+ '--debug' : Boolean ,
1516 // Aliases
1617 '-h' : '--help' ,
18+ '-d' : '--debug' ,
1719 }
1820
1921 let args : arg . Result < arg . Spec >
@@ -53,7 +55,7 @@ const nextBuild: cliCommand = (argv) => {
5355 printAndExit ( `> No such directory exists as the project root: ${ dir } ` )
5456 }
5557
56- build ( dir , null , args [ '--profile' ] )
58+ build ( dir , null , args [ '--profile' ] , args [ '--debug' ] )
5759 . then ( ( ) => process . exit ( 0 ) )
5860 . catch ( ( err ) => {
5961 console . error ( '' )
Original file line number Diff line number Diff line change @@ -988,7 +988,7 @@ const runTests = (isDev = false) => {
988988 } )
989989 } )
990990
991- it ( 'should have redirects/rewrites in build output' , async ( ) => {
991+ it ( 'should have redirects/rewrites in build output with debug flag ' , async ( ) => {
992992 const manifest = await fs . readJSON (
993993 join ( appDir , '.next/routes-manifest.json' )
994994 )
@@ -1073,7 +1073,7 @@ describe('Custom routes', () => {
10731073
10741074 describe ( 'server mode' , ( ) => {
10751075 beforeAll ( async ( ) => {
1076- const { stdout : buildStdout } = await nextBuild ( appDir , [ ] , {
1076+ const { stdout : buildStdout } = await nextBuild ( appDir , [ '-d' ] , {
10771077 stdout : true ,
10781078 } )
10791079 stdout = buildStdout
@@ -1093,7 +1093,7 @@ describe('Custom routes', () => {
10931093 nextConfigContent . replace ( / \/ \/ t a r g e t / , 'target' ) ,
10941094 'utf8'
10951095 )
1096- const { stdout : buildStdout } = await nextBuild ( appDir , [ ] , {
1096+ const { stdout : buildStdout } = await nextBuild ( appDir , [ '-d' ] , {
10971097 stdout : true ,
10981098 } )
10991099 stdout = buildStdout
You can’t perform that action at this time.
0 commit comments