第一种:
·直接删除node_modules/.cache后再npm start
第二种:
cache: {
cacheDirectory: path.resolve(__dirname, 'node_modules/.cache/.temp_cache'),
type: 'filesystem',
}
官方链接:https://webpack.js.org/configuration/cache/#cache
还有一个GitHuB讨论这个问题的:https://github.com/mzgoddard/hard-source-webpack-plugin/issues/416
个人看法是:
就是生成cache的文件有问题,1.删除重新生成,2.不生成
然后缓存嘛有肯定是有好处的,所以推荐1删除重新生成