Skip to content

Commit 2af0861

Browse files
committed
feat: enable performance.buildCache by default
1 parent ccc4a23 commit 2af0861

File tree

9 files changed

+31
-3
lines changed

9 files changed

+31
-3
lines changed

packages/core/src/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ export async function createConstantRsbuildConfig(): Promise<EnvironmentConfig>
508508
chunkSplit: {
509509
strategy: 'custom',
510510
},
511+
buildCache: true,
511512
},
512513
tools: {
513514
htmlPlugin: false,

packages/core/tests/__snapshots__/config.test.ts.snap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
112112
"target": "node",
113113
},
114114
"performance": {
115+
"buildCache": true,
115116
"chunkSplit": {
116117
"strategy": "custom",
117118
},
@@ -382,6 +383,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
382383
"target": "node",
383384
},
384385
"performance": {
386+
"buildCache": true,
385387
"chunkSplit": {
386388
"strategy": "custom",
387389
},
@@ -636,6 +638,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
636638
"target": "node",
637639
},
638640
"performance": {
641+
"buildCache": true,
639642
"chunkSplit": {
640643
"strategy": "custom",
641644
},
@@ -865,6 +868,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
865868
"target": "node",
866869
},
867870
"performance": {
871+
"buildCache": true,
868872
"chunkSplit": {
869873
"strategy": "custom",
870874
},
@@ -1048,6 +1052,7 @@ exports[`Should compose create Rsbuild config correctly > Merge Rsbuild config i
10481052
"target": "web",
10491053
},
10501054
"performance": {
1055+
"buildCache": true,
10511056
"chunkSplit": {
10521057
"strategy": "custom",
10531058
},

tests/integration/auto-external/module-import-warn/rslib.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,7 @@ export default defineConfig({
2424
'e7',
2525
],
2626
},
27+
performance: {
28+
buildCache: false,
29+
},
2730
});
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
!node_modules/
1+
!node_modules/
2+
.cache

tests/integration/dts/bundle-false/tsconfig-path/rslib.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ export default defineConfig({
1010
},
1111
}),
1212
],
13+
performance: {
14+
buildCache: false,
15+
},
1316
source: {
1417
entry: {
1518
index: '../__fixtures__/src/index.ts',

tests/integration/externals/module-import-warn/rslib.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,7 @@ export default defineConfig({
1717
output: {
1818
externals: ['bar', /^qux$/, 'quxx'],
1919
},
20+
performance: {
21+
buildCache: false,
22+
},
2023
});
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
!node_modules/
1+
!node_modules/
2+
.cache

tests/scripts/shared.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ export async function getResults(
207207
const updateConfigForTest = (rslibConfig: RslibConfig) => {
208208
Object.assign(rslibConfig, {
209209
performance: {
210+
...rslibConfig.performance,
210211
// Do not print file size in tests
211212
printFileSize: false,
212213
},

website/rspress.config.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,17 @@ export default defineConfig({
141141
dev: {
142142
lazyCompilation: true,
143143
},
144-
resolve: {
144+
tools: {
145+
rspack: {
146+
cache: true,
147+
experiments: {
148+
cache: {
149+
type: 'persistent',
150+
},
151+
},
152+
},
153+
},
154+
source: {
145155
alias: {
146156
'@components': path.join(__dirname, '@components'),
147157
'@en': path.join(__dirname, 'docs/en'),

0 commit comments

Comments
 (0)