Open hzsrc opened 3 years ago
In webpack 5.x, the compiler.hooks
can not add any property into it.
So, when get the hardSourceCacheFactory
property in tapable.hooks
, it returns undefined:
@hzsrc What's the update?
@amerllica FYI I was able to remove this plugin completely in favor of native Webpack 5 filesystem caching.
This is what I added to my webpack.config.js
to enable it:
cache: {
type: 'filesystem',
buildDependencies: {
config: [__filename]
}
},
On the first run of the dev server it populates the cache and takes ~1min, when I re-run it starts up in ~10s.
Also see https://github.com/mzgoddard/hard-source-webpack-plugin/issues/514#issuecomment-687621600
@phillipuniverse, Thanks for your comment, my project is so big, very very big, so by using the native Webpack caching system, after the first time, I reduce the re-build time to 1min, I hope to find a way to reduce it below 300ms.
Finally, thanks.
Expected Behavior
Actual Behavior
Is an error being thrown?
Windows 10 node@12.12 npm@6.11.3
"devDependencies": { "babel-core": "^6.26.0", "babel-loader": "^7.1.4", "babel-preset-env": "^1.6.1", "css-loader": "^0.27.0", "html-webpack-plugin": "^3.2.0", "mini-css-extract-plugin": "^0.4.0", "style-loader": "^0.14.0", "webpack": "^5.24.3", "webpack-cli": "^1.5.3" }, "dependencies": { "lodash": "^4.15.0" }