File tree Expand file tree Collapse file tree 3 files changed +45
-2
lines changed Expand file tree Collapse file tree 3 files changed +45
-2
lines changed Original file line number Diff line number Diff line change @@ -520,7 +520,11 @@ export async function createConstantRsbuildConfig(): Promise<EnvironmentConfig>
520
520
moduleIds : 'named' ,
521
521
nodeEnv : false ,
522
522
} ,
523
+ cache : true ,
523
524
experiments : {
525
+ cache : {
526
+ type : 'persistent' ,
527
+ } ,
524
528
rspackFuture : {
525
529
bundlerInfo : {
526
530
force : false ,
@@ -1768,7 +1772,20 @@ export async function composeRsbuildEnvironments(
1768
1772
1769
1773
for ( const { format, id, config } of rsbuildConfigWithLibInfo ) {
1770
1774
const libId = typeof id === 'string' ? id : composeDefaultId ( format ) ;
1771
- environments [ libId ] = config ;
1775
+ environments [ libId ] = mergeRsbuildConfig ( config , {
1776
+ tools : {
1777
+ rspack : {
1778
+ experiments : {
1779
+ cache : {
1780
+ version :
1781
+ libId +
1782
+ config . source ?. entry ?. index +
1783
+ config . output ?. distPath ?. root ,
1784
+ } ,
1785
+ } ,
1786
+ } ,
1787
+ } ,
1788
+ } as EnvironmentConfig ) ;
1772
1789
environmentWithInfos . push ( { id : libId , format, config } ) ;
1773
1790
}
1774
1791
Original file line number Diff line number Diff line change @@ -137,7 +137,11 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
137
137
" htmlPlugin" : false ,
138
138
" rspack" : [
139
139
{
140
+ " cache" : true ,
140
141
" experiments" : {
142
+ " cache" : {
143
+ " type" : " persistent" ,
144
+ },
141
145
" rspackFuture" : {
142
146
" bundlerInfo" : {
143
147
" force" : false ,
@@ -405,7 +409,11 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
405
409
" htmlPlugin" : false ,
406
410
" rspack" : [
407
411
{
412
+ " cache" : true ,
408
413
" experiments" : {
414
+ " cache" : {
415
+ " type" : " persistent" ,
416
+ },
409
417
" rspackFuture" : {
410
418
" bundlerInfo" : {
411
419
" force" : false ,
@@ -640,7 +648,11 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
640
648
" htmlPlugin" : false ,
641
649
" rspack" : [
642
650
{
651
+ " cache" : true ,
643
652
" experiments" : {
653
+ " cache" : {
654
+ " type" : " persistent" ,
655
+ },
644
656
" rspackFuture" : {
645
657
" bundlerInfo" : {
646
658
" force" : false ,
@@ -1056,7 +1068,11 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
1056
1068
" htmlPlugin" : false ,
1057
1069
" rspack" : [
1058
1070
{
1071
+ " cache" : true ,
1059
1072
" experiments" : {
1073
+ " cache" : {
1074
+ " type" : " persistent" ,
1075
+ },
1060
1076
" rspackFuture" : {
1061
1077
" bundlerInfo" : {
1062
1078
" force" : false ,
Original file line number Diff line number Diff line change @@ -141,7 +141,17 @@ export default defineConfig({
141
141
dev : {
142
142
lazyCompilation : true ,
143
143
} ,
144
- resolve : {
144
+ tools : {
145
+ rspack : {
146
+ cache : true ,
147
+ experiments : {
148
+ cache : {
149
+ type : 'persistent' ,
150
+ } ,
151
+ } ,
152
+ } ,
153
+ } ,
154
+ source : {
145
155
alias : {
146
156
'@components' : path . join ( __dirname , '@components' ) ,
147
157
'@en' : path . join ( __dirname , 'docs/en' ) ,
You can’t perform that action at this time.
0 commit comments