Skip to content

Commit 36b2323

Browse files
committed
fix: switch to memory webpack cache
1 parent 019794f commit 36b2323

2 files changed

Lines changed: 6 additions & 20 deletions

File tree

.changeset/quiet-teal-mice.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@ima/cli": patch
3+
---
4+
5+
Switch from `filesystem` to `memory` webpack cache configuration. The filesystem cache was causing issues with webpack v5.100.0+, which led to `ima dev` command failing if a cache from a previous run existed and files in node_modules were changed. We might consider switching back to `filesystem` cache once we figure out the root cause of the issue.

packages/cli/src/webpack/config.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ import { GenerateRunnerPlugin } from './plugins/GenerateRunnerPlugin';
2626
import { ManifestPlugin } from './plugins/ManifestPlugin';
2727
import { createProgress } from './plugins/ProgressPlugin';
2828
import {
29-
createCacheKey,
30-
IMA_CONF_FILENAME,
3129
createPolyfillEntry,
3230
createDevServerConfig,
3331
getCurrentCoreJsVersion,
@@ -283,24 +281,7 @@ export default async (
283281
hotUpdateMainFilename: `${outputFolders.hot}/[runtime].[fullhash].hot-update.json`,
284282
...(isServer && { library: { type: 'commonjs2' } }),
285283
},
286-
cache: {
287-
type: 'filesystem',
288-
name: `${name}-${ctx.command}-${mode}`,
289-
version: createCacheKey(ctx, imaConfig, {
290-
...devServerConfig,
291-
$Debug: isDebug,
292-
coreJsVersion: 'core-js',
293-
devtool,
294-
}),
295-
store: 'pack',
296-
hashAlgorithm: 'xxhash64',
297-
memoryCacheUnaffected: true,
298-
buildDependencies: {
299-
imaCli: [require.resolve('@ima/cli')],
300-
imaConfig: [path.join(rootDir, IMA_CONF_FILENAME)],
301-
defaultConfig: [__filename],
302-
},
303-
},
284+
cache: { type: 'memory' },
304285
optimization: {
305286
minimize: ctx.command === 'build' && !isServer,
306287
minimizer: [

0 commit comments

Comments
 (0)