@@ -81,10 +81,11 @@ pub struct NextConfig {
8181 config_file : Option < RcStr > ,
8282 config_file_name : RcStr ,
8383
84+ cache_life : Option < FxIndexMap < String , CacheLifeProfile > > ,
8485 /// In-memory cache size in bytes.
8586 ///
8687 /// If `cache_max_memory_size: 0` disables in-memory caching.
87- cache_max_memory_size : Option < f64 > ,
88+ cache_max_memory_size : Option < serde_json :: Value > ,
8889 /// custom path to a cache handler to use
8990 cache_handler : Option < RcStr > ,
9091 cache_handlers : Option < FxIndexMap < RcStr , RcStr > > ,
@@ -835,7 +836,6 @@ pub struct ExperimentalConfig {
835836 adjust_font_fallbacks_with_size_adjust : Option < bool > ,
836837 after : Option < bool > ,
837838 app_document_preloading : Option < bool > ,
838- cache_life : Option < FxIndexMap < String , CacheLifeProfile > > ,
839839 case_sensitive_routes : Option < bool > ,
840840 cpus : Option < f64 > ,
841841 cra_compat : Option < bool > ,
@@ -909,7 +909,7 @@ pub struct ExperimentalConfig {
909909}
910910
911911#[ derive(
912- Clone , Debug , PartialEq , Serialize , Deserialize , TraceRawVcs , NonLocalValue , OperationValue ,
912+ Clone , Debug , PartialEq , Eq , Serialize , Deserialize , TraceRawVcs , NonLocalValue , OperationValue ,
913913) ]
914914#[ serde( rename_all = "camelCase" ) ]
915915pub struct CacheLifeProfile {
@@ -1175,6 +1175,9 @@ pub struct OptionServerActions(Option<ServerActions>);
11751175#[ turbo_tasks:: value( transparent) ]
11761176pub struct OptionJsonValue ( pub Option < serde_json:: Value > ) ;
11771177
1178+ #[ turbo_tasks:: value( transparent) ]
1179+ pub struct OptionCacheLife ( Option < FxIndexMap < String , CacheLifeProfile > > ) ;
1180+
11781181fn turbopack_config_documentation_link ( ) -> RcStr {
11791182 rcstr ! ( "https://nextjs.org/docs/app/api-reference/config/next-config-js/turbopack#configuring-webpack-loaders" )
11801183}
@@ -1312,6 +1315,16 @@ impl NextConfig {
13121315 Vc :: cell ( self . base_path . clone ( ) )
13131316 }
13141317
1318+ #[ turbo_tasks:: function]
1319+ pub fn cache_life ( & self ) -> Vc < OptionCacheLife > {
1320+ Vc :: cell ( self . cache_life . clone ( ) )
1321+ }
1322+
1323+ #[ turbo_tasks:: function]
1324+ pub fn cache_max_memory_size ( & self ) -> Vc < OptionJsonValue > {
1325+ Vc :: cell ( self . cache_max_memory_size . clone ( ) )
1326+ }
1327+
13151328 #[ turbo_tasks:: function]
13161329 pub fn cache_handler ( & self , project_path : FileSystemPath ) -> Result < Vc < OptionFileSystemPath > > {
13171330 if let Some ( handler) = & self . cache_handler {
0 commit comments