File tree Expand file tree Collapse file tree 4 files changed +23
-1
lines changed Expand file tree Collapse file tree 4 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -785,7 +785,12 @@ impl Project {
785
785
786
786
#[ turbo_tasks:: function]
787
787
pub ( super ) async fn per_page_module_graph ( & self ) -> Result < Vc < bool > > {
788
- Ok ( Vc :: cell ( * self . mode . await ? == NextMode :: Development ) )
788
+ Ok ( Vc :: cell (
789
+ !* self
790
+ . next_config
791
+ . turbo_use_whole_app_module_graph ( * self . mode )
792
+ . await ?,
793
+ ) )
789
794
}
790
795
791
796
#[ turbo_tasks:: function]
Original file line number Diff line number Diff line change @@ -877,6 +877,7 @@ pub struct ExperimentalConfig {
877
877
turbopack_tree_shaking : Option < bool > ,
878
878
turbopack_scope_hoisting : Option < bool > ,
879
879
turbopack_use_system_tls_certs : Option < bool > ,
880
+ turbopack_use_whole_app_module_graph_in_dev : Option < bool > ,
880
881
/// Disable automatic configuration of the sass loader.
881
882
#[ serde( default ) ]
882
883
turbopack_use_builtin_sass : Option < bool > ,
@@ -1839,6 +1840,16 @@ impl NextConfig {
1839
1840
} ) )
1840
1841
}
1841
1842
1843
+ #[ turbo_tasks:: function]
1844
+ pub async fn turbo_use_whole_app_module_graph ( & self , mode : Vc < NextMode > ) -> Result < Vc < bool > > {
1845
+ Ok ( Vc :: cell ( match * mode. await ? {
1846
+ NextMode :: Development => self
1847
+ . experimental
1848
+ . turbopack_use_whole_app_module_graph_in_dev
1849
+ . unwrap_or ( false ) ,
1850
+ NextMode :: Build => true ,
1851
+ } ) )
1852
+ }
1842
1853
#[ turbo_tasks:: function]
1843
1854
pub async fn client_source_maps ( & self , mode : Vc < NextMode > ) -> Result < Vc < bool > > {
1844
1855
let source_maps = self . experimental . turbopack_source_maps ;
Original file line number Diff line number Diff line change @@ -476,6 +476,7 @@ export const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>
476
476
turbopackUseSystemTlsCerts : z . boolean ( ) . optional ( ) ,
477
477
turbopackUseBuiltinBabel : z . boolean ( ) . optional ( ) ,
478
478
turbopackUseBuiltinSass : z . boolean ( ) . optional ( ) ,
479
+ turbopackUseWholeAppModuleGraphInDev : z . boolean ( ) . optional ( ) ,
479
480
optimizePackageImports : z . array ( z . string ( ) ) . optional ( ) ,
480
481
optimizeServerReact : z . boolean ( ) . optional ( ) ,
481
482
clientTraceMetadata : z . array ( z . string ( ) ) . optional ( ) ,
Original file line number Diff line number Diff line change @@ -660,6 +660,11 @@ export interface ExperimentalConfig {
660
660
*/
661
661
turbopackUseBuiltinSass ?: boolean
662
662
663
+ /**
664
+ * Whether to use the whole app module graph in development mode. This makes development mode chunking more like production but may come with an HMR performance regression.
665
+ */
666
+ turbopackUseWholeAppModuleGraphInDev ?: boolean
667
+
663
668
/**
664
669
* For use with `@next/mdx`. Compile MDX files using the new Rust compiler.
665
670
* @see https://nextjs.org/docs/app/api-reference/next-config-js/mdxRs
You can’t perform that action at this time.
0 commit comments