简体   繁体   English

Ionic 2 - 使用源映射调试Typescript文件

[英]Ionic 2 - debugging Typescript files using source maps

I am using Ionic 2 RC1. 我正在使用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. 我想知道如何为每个.ts文件包含源映射,该文件被转换为main.js文件并在main.js.map中包含它们的映射。

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. 不知何故,当试图调试加载到从Safari连接到我的Mac的iPad的应用程序时,我没有看到.map文件在网络选项卡或资源选项卡中被加载/可见。 I turned on Web Inspector on my iPad. 我在iPad上打开了Web Inspector。

How do I troubleshoot source map missbehaviour and what can I do to make it available in Safari, Chrome and other browsers. 如何解决源地图missbehaviour问题,以及如何使其在Safari,Chrome和其他浏览器中可用。 Thanks, Rad 谢谢,Rad

Update 1: I am using these npm packages: 更新1:我正在使用这些npm包:

"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"
},

你应该在你的依赖包package.json文件中使用“@ ionic / app-scripts”:“0.0.36” - 这应该可以完成工作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM