Skip to content

Commit 76d53b5

Browse files
authoredNov 19, 2020
Merge pull request #13165 from storybookjs/13156-fix-cached-manager
Core: Fix using cached manager on the 2nd run
2 parents 4747fea + 74693f4 commit 76d53b5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎lib/core/src/server/dev-server.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,17 @@ const startManager = async ({
222222

223223
if (options.cache) {
224224
if (options.managerCache) {
225-
const configString = stringify(managerConfig);
225+
// Drop the `cache` property because it'll change as a result of writing to the cache.
226+
const { cache: _, ...baseConfig } = managerConfig;
227+
const configString = stringify(baseConfig);
226228
const cachedConfig = await options.cache.get('managerConfig');
227229
options.cache.set('managerConfig', configString);
228230
if (configString === cachedConfig && (await pathExists(outputDir))) {
229231
logger.info('=> Using cached manager');
230232
managerConfig = null;
231233
}
232234
} else {
235+
logger.info('=> Removing cached managerConfig');
233236
options.cache.remove('managerConfig');
234237
}
235238
}

0 commit comments

Comments
 (0)
Please sign in to comment.