hard-source-webpack-plugin icon indicating copy to clipboard operation
hard-source-webpack-plugin copied to clipboard

Cache rebuile every time

Open ikobe-zz opened this issue 6 years ago • 2 comments

Expected Behavior

Expect cache will work

Actual Behavior

default

Cache not work

Each time start up, cache will rebuild

Is an error being thrown?

[hardsource:cloud] Cache is corrupted. Error: ENOENT: no such file or directory, open './run/webpack_cache/hard_source/cloud/module~/log0053' [hardsource:cloud] Last compilation did not finish saving. Building new cache.

Steps to Reproduce

  return new HardSourceWebpackPlugin({
    cacheDirectory: `${path.join(process.cwd(), './run/webpack_cache/hard_source/[confighash]')}`,
    configHash: process.env.EGG_DEPLOY === 'cloud' ? 'cloud' : 'default',
    cachePrune: {
      sizeThreshold: 300 * 1024 * 1024,  // 300 MB
    },
  });

Operating System, Node, and NPM dependency versions

Mac OS 10.11.6
Node 8.9.1

"hard-source-webpack-plugin": "^0.12.0",

ikobe-zz avatar Aug 17 '18 08:08 ikobe-zz

Same when using yarn with: "hard-source-webpack-plugin": "^0.12.0" "webpack": "^4.6.0"

EDIT: Downgrading to 0.11.1 seems to have solved it, however reading from cache is actually slower than just rebuilding

WhoAteDaCake avatar Aug 24 '18 08:08 WhoAteDaCake

Only works when comenting "cacheDirectory" and using default config.

borntorun avatar Dec 18 '18 12:12 borntorun