File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change @@ -473,7 +473,11 @@ export async function createConstantRsbuildConfig(): Promise<EnvironmentConfig>
473473 moduleIds : 'named' ,
474474 nodeEnv : false ,
475475 } ,
476+ cache : true ,
476477 experiments : {
478+ cache : {
479+ type : 'persistent' ,
480+ } ,
477481 rspackFuture : {
478482 bundlerInfo : {
479483 force : false ,
@@ -1616,7 +1620,20 @@ export async function composeRsbuildEnvironments(
16161620
16171621 for ( const { format, id, config } of rsbuildConfigWithLibInfo ) {
16181622 const libId = typeof id === 'string' ? id : composeDefaultId ( format ) ;
1619- environments [ libId ] = config ;
1623+ environments [ libId ] = mergeRsbuildConfig ( config , {
1624+ tools : {
1625+ rspack : {
1626+ experiments : {
1627+ cache : {
1628+ version :
1629+ libId +
1630+ config . source ?. entry ?. index +
1631+ config . output ?. distPath ?. root ,
1632+ } ,
1633+ } ,
1634+ } ,
1635+ } ,
1636+ } as EnvironmentConfig ) ;
16201637 environmentWithInfos . push ( { id : libId , format, config } ) ;
16211638 }
16221639
Original file line number Diff line number Diff line change @@ -140,7 +140,11 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
140140 " htmlPlugin" : false ,
141141 " rspack" : [
142142 {
143+ " cache" : true ,
143144 " experiments" : {
145+ " cache" : {
146+ " type" : " persistent" ,
147+ },
144148 " rspackFuture" : {
145149 " bundlerInfo" : {
146150 " force" : false ,
@@ -395,7 +399,11 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
395399 " htmlPlugin" : false ,
396400 " rspack" : [
397401 {
402+ " cache" : true ,
398403 " experiments" : {
404+ " cache" : {
405+ " type" : " persistent" ,
406+ },
399407 " rspackFuture" : {
400408 " bundlerInfo" : {
401409 " force" : false ,
@@ -621,7 +629,11 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
621629 " htmlPlugin" : false ,
622630 " rspack" : [
623631 {
632+ " cache" : true ,
624633 " experiments" : {
634+ " cache" : {
635+ " type" : " persistent" ,
636+ },
625637 " rspackFuture" : {
626638 " bundlerInfo" : {
627639 " force" : false ,
@@ -794,7 +806,11 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
794806 " htmlPlugin" : false ,
795807 " rspack" : [
796808 {
809+ " cache" : true ,
797810 " experiments" : {
811+ " cache" : {
812+ " type" : " persistent" ,
813+ },
798814 " rspackFuture" : {
799815 " bundlerInfo" : {
800816 " force" : false ,
Original file line number Diff line number Diff line change @@ -84,6 +84,16 @@ export default defineConfig({
8484 dev : {
8585 lazyCompilation : true ,
8686 } ,
87+ tools : {
88+ rspack : {
89+ cache : true ,
90+ experiments : {
91+ cache : {
92+ type : 'persistent' ,
93+ } ,
94+ } ,
95+ } ,
96+ } ,
8797 source : {
8898 alias : {
8999 '@components' : path . join ( __dirname , '@components' ) ,
You can’t perform that action at this time.
0 commit comments