@@ -189,6 +189,9 @@ pub struct ProjectOptions {
189189 /// debugging/profiling purposes.
190190 pub no_mangling : bool ,
191191
192+ /// Whether to write the route hashes manifest.
193+ pub write_routes_hashes_manifest : bool ,
194+
192195 /// The version of Node.js that is available/currently running.
193196 pub current_node_js_version : RcStr ,
194197}
@@ -237,6 +240,9 @@ pub struct PartialProjectOptions {
237240 /// local names for variables, functions etc., which can be useful for
238241 /// debugging/profiling purposes.
239242 pub no_mangling : Option < bool > ,
243+
244+ /// Whether to write the route hashes manifest.
245+ pub write_routes_hashes_manifest : Option < bool > ,
240246}
241247
242248#[ derive(
@@ -357,6 +363,7 @@ impl ProjectContainer {
357363 preview_props,
358364 browserslist_query,
359365 no_mangling,
366+ write_routes_hashes_manifest,
360367 } = options;
361368
362369 let resolved_self = self . to_resolved ( ) . await ?;
@@ -404,6 +411,9 @@ impl ProjectContainer {
404411 if let Some ( no_mangling) = no_mangling {
405412 new_options. no_mangling = no_mangling;
406413 }
414+ if let Some ( write_routes_hashes_manifest) = write_routes_hashes_manifest {
415+ new_options. write_routes_hashes_manifest = write_routes_hashes_manifest;
416+ }
407417
408418 // TODO: Handle mode switch, should prevent mode being switched.
409419 let watch = new_options. watch ;
@@ -468,6 +478,7 @@ impl ProjectContainer {
468478 let preview_props;
469479 let browserslist_query;
470480 let no_mangling;
481+ let write_routes_hashes_manifest;
471482 let current_node_js_version;
472483 {
473484 let options = self . options_state . get ( ) ;
@@ -491,6 +502,7 @@ impl ProjectContainer {
491502 preview_props = options. preview_props . clone ( ) ;
492503 browserslist_query = options. browserslist_query . clone ( ) ;
493504 no_mangling = options. no_mangling ;
505+ write_routes_hashes_manifest = options. write_routes_hashes_manifest ;
494506 current_node_js_version = options. current_node_js_version . clone ( ) ;
495507 }
496508
@@ -516,6 +528,7 @@ impl ProjectContainer {
516528 encryption_key,
517529 preview_props,
518530 no_mangling,
531+ write_routes_hashes_manifest,
519532 current_node_js_version,
520533 }
521534 . cell ( ) )
@@ -603,6 +616,9 @@ pub struct Project {
603616 /// debugging/profiling purposes.
604617 no_mangling : bool ,
605618
619+ /// Whether to write the route hashes manifest.
620+ write_routes_hashes_manifest : bool ,
621+
606622 current_node_js_version : RcStr ,
607623}
608624
@@ -823,6 +839,11 @@ impl Project {
823839 Ok ( Vc :: cell ( self . watch . enable ) )
824840 }
825841
842+ #[ turbo_tasks:: function]
843+ pub ( super ) fn should_write_routes_hashes_manifest ( & self ) -> Result < Vc < bool > > {
844+ Ok ( Vc :: cell ( self . write_routes_hashes_manifest ) )
845+ }
846+
826847 #[ turbo_tasks:: function]
827848 pub ( super ) async fn per_page_module_graph ( & self ) -> Result < Vc < bool > > {
828849 Ok ( Vc :: cell ( * self . mode . await ? == NextMode :: Development ) )
0 commit comments