尽管调试已关闭,但 UI5 仍继续加载调试源

UI5 keeps loading debug sources despite debugging turned off

我的 SAPUI5 应用程序通过 SAP CDN 使用模块。在 DevTools Network 选项卡中,我看到许多文件的 initiator 是调试版本(例如,jquery-dbg.js ).我用 SAPUI5 诊断工具检查过,调试被禁用。

URL 中也没有提供 sap-ui-debug=true 标志。
我什至尝试将以下代码添加到 index.html<script> 部分,但没有帮助:

window["sap-ui-config"] = {
    "productive" : true
};

问题:
如何从 jquery-dbg.js 切换到 jQuery 构建的 production/minified?

I see that the initiator of loading many files is a debug version

这没有错。之所以显示 -dbg.js 个文件是因为浏览器将源代码与生产代码进行了映射,以便于阅读和调试。在幕后,生产代码仍然是 运行.

例如,要在 Chrome 中禁用源映射,请转到开发工具 > 设置 > 取消选中 "Enable Javascript source maps"