Skip to content

Commit 37afe36

Browse files
authored
fix: compat chain.cache true (#6824)
1 parent 96a8726 commit 37afe36

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.changeset/smart-tigers-breathe.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@modern-js/uni-builder': patch
3+
---
4+
5+
fix: compat chain.cache true

packages/cli/uni-builder/src/shared/plugins/frameworkConfig.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ export const pluginFrameworkConfig = (configPath: string): RsbuildPlugin => ({
66

77
setup(api) {
88
api.modifyBundlerChain(chain => {
9-
if (!fs.existsSync(configPath)) {
9+
// TODO: Support rspack after support `performance.buildCache.buildDependencies` configuration
10+
if (!fs.existsSync(configPath) || api.context.bundlerType !== 'webpack') {
1011
return;
1112
}
1213

@@ -16,6 +17,14 @@ export const pluginFrameworkConfig = (configPath: string): RsbuildPlugin => ({
1617
return;
1718
}
1819

20+
if (cache === true) {
21+
chain.cache({
22+
buildDependencies: {
23+
frameworkConfig: [configPath],
24+
},
25+
});
26+
}
27+
1928
cache.buildDependencies = {
2029
...cache.buildDependencies,
2130
frameworkConfig: [configPath],

0 commit comments

Comments
 (0)