如何使用 WebStorm 在 >>one<< 单击中调试 Angular 应用程序?
How to debug an Angular application in >>one<< click with WebStorm?
好的,我已经检查过了:
- https://blog.jetbrains.com/webstorm/2017/01/debugging-angular-apps/
- How to debug an application in Angular2 using angular-cli?
- https://manuel-rauber.com/2016/09/30/how-to-debug-angular-2-with-webstorm/
Jetbrains 博客上描述的解决方案有效,但有一件事真正困扰我:
Run npm start
to get the app running in the development mode. You can
do this either in the terminal or by double-clicking the task in the
npm tool window in WebStorm.
显然我试图在实际调试之前放置 npm start / ng serve 但你可能知道这实际上阻止了调试阶段:
似乎不可能同时拥有 运行 和停止,而不必分别手动启动它们。
任何解决方法/解决方案?
添加一个 NPM 运行 配置到 Before launch 部分将不起作用,因为主进程将等待return 来自进程 运行 的代码,在 启动前 中(并且在终止之前不会启动)。这就是 'before launch' 的设计方式 - 它应该用于 运行 在 运行 主进程之前进行某种预处理。如果需要并行调试两个进程,可以尝试自定义 Multirun plugin:
更新:自 2018.1 起,您还可以为此使用 Compound 运行 配置。唯一的缺点(与 Multi运行 相比)是无法指定执行顺序和延迟,因此两个配置将同时为 运行,一旦 webpack 将刷新浏览器构建完成
好的,我已经检查过了:
- https://blog.jetbrains.com/webstorm/2017/01/debugging-angular-apps/
- How to debug an application in Angular2 using angular-cli?
- https://manuel-rauber.com/2016/09/30/how-to-debug-angular-2-with-webstorm/
Jetbrains 博客上描述的解决方案有效,但有一件事真正困扰我:
Run
npm start
to get the app running in the development mode. You can do this either in the terminal or by double-clicking the task in the npm tool window in WebStorm.
显然我试图在实际调试之前放置 npm start / ng serve 但你可能知道这实际上阻止了调试阶段:
似乎不可能同时拥有 运行 和停止,而不必分别手动启动它们。
任何解决方法/解决方案?
添加一个 NPM 运行 配置到 Before launch 部分将不起作用,因为主进程将等待return 来自进程 运行 的代码,在 启动前 中(并且在终止之前不会启动)。这就是 'before launch' 的设计方式 - 它应该用于 运行 在 运行 主进程之前进行某种预处理。如果需要并行调试两个进程,可以尝试自定义 Multirun plugin:
更新:自 2018.1 起,您还可以为此使用 Compound 运行 配置。唯一的缺点(与 Multi运行 相比)是无法指定执行顺序和延迟,因此两个配置将同时为 运行,一旦 webpack 将刷新浏览器构建完成