Ionic 2-使用源映射调试Typescript文件 [英] Ionic 2 - debugging Typescript files using source maps

查看:143
本文介绍了Ionic 2-使用源映射调试Typescript文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Ionic 2 RC1.我想知道如何为每个已转换为main.js文件的.ts文件包括源映射,并将它们的映射包含在main.js.map中.

I am using Ionic 2 RC1. I want to know how to include source maps for every .ts file that is transpiled into main.js file and include their mappings in main.js.map.

以某种方式尝试调试从Safari浏览器连接到Mac的iPad中加载的应用程序时,在网络标签或资源标签中看不到.map文件正在加载/可见.我在iPad上打开了Web Inspector.

Somehow when trying to debug the app loaded into an iPad connected to my Mac from Safari, I don't see .map file being loaded/visible in the network tab or resource tab. I turned on Web Inspector on my iPad.

如何解决源地图的不当行为以及如何使其在Safari,Chrome和其他浏览器中可用. 谢谢, 拉德

How do I troubleshoot source map missbehaviour and what can I do to make it available in Safari, Chrome and other browsers. Thanks, Rad

更新1: 我正在使用以下npm软件包:

Update 1: I am using these npm packages:

"dependencies": {
"@angular/common": "2.0.0",
"@angular/compiler": "2.0.0",
"@angular/compiler-cli": "0.6.2",
"@angular/core": "2.0.0",
"@angular/forms": "2.0.0",
"@angular/http": "2.0.0",
"@angular/platform-browser": "2.0.0",
"@angular/platform-browser-dynamic": "2.0.0",
"@angular/platform-server": "2.0.0",
"@ionic/storage": "1.1.6",
"ionic-angular": "2.0.0-rc.1",
"ionic-native": "2.2.3",
"ionicons": "3.0.0",
"rxjs": "5.0.0-beta.12",
"zone.js": "0.6.21"
},
"devDependencies": {
"@ionic/app-scripts": "^0.0.36",
"typescript": "^2.0.3"
},

推荐答案

您应该在依赖关系packages.json文件中使用"@ ionic/app-scripts":"0.0.36"-这应该可以完成工作.

you should use "@ionic/app-scripts": "0.0.36" in your dependencies packages.json file - this should do the work .

这篇关于Ionic 2-使用源映射调试Typescript文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆