@@ -275,6 +275,9 @@ pub struct ProjectOptions {
275275 /// Debug build paths for selective builds.
276276 /// When set, only routes matching these paths will be included in the build.
277277 pub debug_build_paths : Option < DebugBuildPaths > ,
278+
279+ /// Whether to enable persistent caching
280+ pub is_persistent_caching_enabled : bool ,
278281}
279282
280283pub struct PartialProjectOptions {
@@ -677,6 +680,7 @@ impl ProjectContainer {
677680 let write_routes_hashes_manifest;
678681 let current_node_js_version;
679682 let debug_build_paths;
683+ let is_persistent_caching_enabled;
680684 {
681685 let options = self . options_state . get ( ) ;
682686 let options = options
@@ -702,6 +706,7 @@ impl ProjectContainer {
702706 write_routes_hashes_manifest = options. write_routes_hashes_manifest ;
703707 current_node_js_version = options. current_node_js_version . clone ( ) ;
704708 debug_build_paths = options. debug_build_paths . clone ( ) ;
709+ is_persistent_caching_enabled = options. is_persistent_caching_enabled ;
705710 }
706711
707712 let dist_dir = next_config. dist_dir ( ) . owned ( ) . await ?;
@@ -729,6 +734,7 @@ impl ProjectContainer {
729734 write_routes_hashes_manifest,
730735 current_node_js_version,
731736 debug_build_paths,
737+ is_persistent_caching_enabled,
732738 }
733739 . cell ( ) )
734740 }
@@ -823,6 +829,9 @@ pub struct Project {
823829 /// Debug build paths for selective builds.
824830 /// When set, only routes matching these paths will be included in the build.
825831 debug_build_paths : Option < DebugBuildPaths > ,
832+
833+ /// Whether to enable persistent caching
834+ is_persistent_caching_enabled : bool ,
826835}
827836
828837#[ turbo_tasks:: value]
@@ -1032,6 +1041,11 @@ impl Project {
10321041 * self . next_config
10331042 }
10341043
1044+ #[ turbo_tasks:: function]
1045+ pub ( super ) fn is_persistent_caching_enabled ( & self ) -> Vc < bool > {
1046+ Vc :: cell ( self . is_persistent_caching_enabled )
1047+ }
1048+
10351049 #[ turbo_tasks:: function]
10361050 pub ( super ) fn next_mode ( & self ) -> Vc < NextMode > {
10371051 * self . mode
@@ -1499,7 +1513,7 @@ impl Project {
14991513 ) ;
15001514 emit_event (
15011515 "persistentCaching" ,
1502- * config . persistent_caching_enabled ( ) . await ?,
1516+ * self . is_persistent_caching_enabled ( ) . await ?,
15031517 ) ;
15041518
15051519 emit_event (
0 commit comments