我将Vue2与Laravel7一起使用,当我运行npm run prod时,得到错误FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory, 这是全部误差。
[3521:0x302b050]110565 ms:Mark-sweep 489.2(517.6)->485.0(517.6) MB,1150.6/0.0 ms (average mu =0.155, current mu =0.100) allocation failure scavenge might not succeed
[3521:0x302b050]111997 ms:Mark-sweep 489.2(517.6)->485.0(517.6) MB,1222.8/0.0 ms (average mu =0.150, current mu =0.146) allocation failure scavenge might not succeed
4条答案
按热度按时间q5lcpyga1#
只需使用“npm run production”构建您的资产
qhhrdooz2#
方法一
方法2在Laravel中,在laravel配置中添加一个环境变量,并基于运行时加载Vue配置。
定义:
MIX_ENV_MODE=production
用法:
process.env.MIX_ENV_MODE
最后,将此代码添加到任何配置脚本文件中
hvvq6cgz3#
在新版本之前设置手动app.js
使用npm生产/开发
f1tvaqid4#
我将
Vue2
与Laravel7
一起使用,当我运行npm run prod
时,得到错误FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
,这是全部误差。
你知道为什么我会得到这个错误。