Webpack 中设置了 watchOptions 属性
这个问题跟 fsevent 库有关 Mac 中 fsevent 是optionalDevdependence fsevent 的安装貌似又跟 chokidar 有关 chokidar 东西是个旧版本的,需要升级它 它也不是直接安装的,发现它是 webpack-dev-server 的依赖,升级了下 webpack-dev-server cpu usage 就降下来了 :
具体参考: https://github.com/webpack/webpack-dev-server/issues/2140
见下面两条评论 :
https://github.com/webpack/webpack-dev-server/issues/2140#issuecomment-604755149
https://github.com/webpack/webpack-dev-server/issues/2140#issuecomment-604758525
return {
validateStatus: 'error',
errorMsg: 'The prime between 8 and 12 is 11!',
};