cordova - 无法调试模拟的 Ionic 应用程序 - 缩小代码
问题描述
运行这个命令...
ionic cordova emulate android
问题是在调试时,所有代码都被缩小了(vendor.js 和 main.js)——很难调试。
我该如何解决这个问题?我希望看到这两者,因为我的 vendor.js 正在引发错误。我确定有一个 Ionic 设置可以阻止此操作,但我检查了文档并进行了多次搜索,但找不到任何东西。
版本是离子 3。
离子信息内容...
Ionic:
ionic (Ionic CLI) : 4.1.2 (/usr/local/lib/node_modules/ionic)
Ionic Framework : ionic-angular 3.9.2
@ionic/app-scripts : 3.2.0
Cordova:
cordova (Cordova CLI) : 8.0.0
Cordova Platforms : android 7.1.0
Cordova Plugins : cordova-plugin-ionic 4.2.0, cordova-plugin-ionic-keyboard 2.1.2, cordova-plugin-ionic-webview 2.1.3, (and 16 other plugins)
System:
NodeJS : v10.10.0 (/usr/local/Cellar/node/10.10.0/bin/node)
npm : 6.4.1
OS : macOS High Sierra
谢谢!
解决方案
选项 1:
使用--livereload
参数运行。我发现在进行远程调试时使用实时重新加载比不使用实时重新加载更一致地提供源映射。
选项 2: 将以下内容添加到您的 package.json 文件中。这也适用于我。不确定这是否会影响产品构建,因此您可能只想在主动调试时使用这个。
"config": {
"ionic_bundler": "webpack",
"ionic_source_map_type": "#inline-source-map"
}
推荐阅读
- java - 升级Redis服务器时无法获取Redis Lock,进程卡住
- arrays - 返回 Json 数组的最佳方法是什么?
- javascript - 将对象值动态分配给变量 javascript
- javascript - 每个意图的 TensorFlow 预测都是相同的
- javascript - 如何调用 Sequelize MySQL JSON 查询?
- c# - 字符串未被识别为有效的时间跨度。C# 和 SQL 服务器
- java - 无法在 AEM 新页面上拖放组件
- google-cloud-platform - 有没有一种快速的方法可以一次删除 VPC 及其所有依赖项?
- django - Django Api 只读字段
- scala - 在类型函数中使用匹配类型时证明类型相等的问题