前言
creat-react-app项目打包时报错:Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
这是分配内存不足导致的
解决方案
1.package.json中修改build,添加--max_old_space_size=8000
"scripts": {
"start": "node scripts/start.js",
"build": "node --max_old_space_size=8000 scripts/build.js",
"test": "node scripts/test.js"
},