首页 > 解决方案 > React 构建未能缩小捆绑包。来自 UglifyJs 的错误

问题描述

当我尝试使用以下命令进行构建时,我的反应应用程序随机停止工作:

npm run-script build

错误是:

无法缩小捆绑包。错误:来自 UglifyJs RangeError 的 static/js/main.4f3a37aa.js:C:\Mist_Applications_Ltd\ASIRTAPORTAL\ASIRTAPORTAL\ClientApp\scripts\build.js:120:23 处 C:\Mist_Applications_Ltd\ASIRTAPORTAL\ASIRTAPORTAL\ClientApp\scripts\build.js:120:23 处的最大调用堆栈大小超出: \Mist_Applications_Ltd\ASIRTAPORTAL\ASIRTAPORTAL\ClientApp\node_modules\webpack\lib\Compiler.js:269:13 在 Compiler.emitRecords (C:\Mist_Applications_Ltd\ASIRTAPORTAL\ASIRTAPORTAL\ClientApp\node_modules\webpack\lib\Compiler.js:375: 38) 在 C:\Mist_Applications_Ltd\ASIRTAPORTAL\ASIRTAPORTAL\ClientApp\node_modules\webpack\lib\Compiler.js:262:10 在 C:\Mist_Applications_Ltd\ASIRTAPORTAL\ASIRTAPORTAL\ClientApp\node_modules\webpack\lib\Compiler.js:368 :12 在编译器的下一个 (C:\Mist_Applications_Ltd\ASIRTAPORTAL\ASIRTAPORTAL\ClientApp\node_modules\tapable\lib\Tapable.js:218:11)。(C:

我的 json 包的 webpack 部分如下所示:

图片

我尝试了很多东西,只是不明白为什么事情突然停止工作!

标签: reactjsnpmwebpackuglifyjs

解决方案


推荐阅读