MCPcopy Index your code
hub / github.com/facebook/docusaurus / getCache

Function getCache

packages/docusaurus/src/webpack/base.ts:124–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122 }
123
124 function getCache(): Configuration['cache'] {
125 // Use default: memory cache in dev, nothing in prod
126 // See https://rspack.dev/config/cache#cache
127 const disabledPersistentCacheValue = undefined;
128
129 if (process.env.DOCUSAURUS_NO_PERSISTENT_CACHE) {
130 return disabledPersistentCacheValue;
131 }
132 if (props.currentBundler.name === 'rspack') {
133 if (props.siteConfig.future.faster.rspackPersistentCache) {
134 // Use cache: true + experiments.cache.type: "persistent"
135 // See https://rspack.dev/config/experiments#persistent-cache
136 return true;
137 } else {
138 return disabledPersistentCacheValue;
139 }
140 }
141
142 return {
143 type: 'filesystem',
144 name: getCacheName(),
145 version: getCacheVersion(),
146 buildDependencies: {
147 config: getCacheBuildDependencies(),
148 },
149 };
150 }
151
152 function getExperiments(): Configuration['experiments'] {
153 if (props.currentBundler.name === 'rspack') {

Callers 1

createBaseConfigFunction · 0.85

Calls 3

getCacheNameFunction · 0.85
getCacheVersionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…