dvajs / dva-example-user-dashboard

👲 👬 👨‍👩‍👧 👨‍👩‍👦‍👦
446 stars 205 forks source link

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory #36

Closed sage-z closed 6 years ago

sage-z commented 7 years ago

我的项目有五六十个页面,使用npm run build打包不成功,报内存溢出错误 ,使用npm run build --max-old-space-size=8192无效

sorrycc commented 7 years ago

npm run build -- --debug 不压缩试试?内存不足感觉是压缩导致的。

sage-z commented 7 years ago

@sorrycc 谢谢!不压缩确实可以,不过打出来的包有105M = =, 我要怎样做才可以压缩呢?

sorrycc commented 7 years ago

这么大的项目。。如果不需要保密的话可以把源码发我研究下怎么优化。(sorrycc#gmail.com)

sorrycc commented 7 years ago

压缩可以在 build 完成后单独做,用 uglifyjs 。

sorrycc commented 7 years ago

105M 可以从公用代码,优化依赖等方面多考虑考虑,应该有很多优化空间的。

sage-z commented 7 years ago

@sorrycc 我把api摘出来发给你吧!谢谢了,主要不是异步加载页面么,然后每个页面都有一套,打包后一个页面大概2M,压缩后估计就300k吧,是sorrycc@gmail.com吧?

sage-z commented 7 years ago

@sorrycc 很抱歉好像被当成垃圾邮件了

syaivin commented 6 years ago

@sorrycc @Zegapaiz 我的项目也碰到你这个问题了,你有方法解决了吗?

sage-z commented 6 years ago

@syaivin https://github.com/sorrycc/roadhog/issues/405