webpack5 cache not working as expected
Using [email protected] version, this is a reproduction demo Step 1: git clone demo Step 2: yarn install Step 3: Modify infrastructureLogging in node_modules/@vercel/ncc/dist/ncc/index.js.cache.js: {debug: /webpack.cache/} to print the webpack cache log Step 4: yarn build executes the first build Step 5: Without making any file changes, yarn build executes the second build Step 6: Without making any file changes, yarn build executes the third build
You will find that after the second time, the build cache will change every time. You can see from the cache log [but build dependencies have changed.]
The expected result is that webpack5 cache can work as expected, and the cache will not be reused every time it is built.