【问题标题】:Angular 5 WebStorm Run ConfigurationAngular 5 WebStorm 运行配置
【发布时间】:2017-11-16 16:17:47
【问题描述】:

我很惊讶 Angular 在 Jet Brain 的 IDE WebStorm 中还没有条目,你们使用哪个运行配置?

我要执行:ng serve

但也许有更好的选择?

类似 vue 的 npm run dev 会在您的默认浏览器中的服务地址打开一个页面?

此页面未点击运行配置,https://www.jetbrains.com/help/webstorm/angular.html

更新:

为了澄清,我正在谈论为 react 和 vue 应用程序制作一键运行按钮:

【问题讨论】:

  • 使用ng serveng serve 使用 webstorm 终端在干净的 angular-cli 项目上工作对我来说很好
  • 我还在一个干净的 angular-cli 项目中使用来自 PhpStorm 终端的ng serve,它可以工作
  • 你指的是调试配置吗?
  • 你们,我的意思是顶部的绿色箭头,这样应用程序可以一键运行,它可以从 powershell 或 webstorm 终端正常运行,我只想从中升级并做什么我为我的 react 和 vue 应用做了。

标签: angular webstorm run-configuration


【解决方案1】:

有关在 WebStorm 中调试 Angular 应用程序的说明,请参阅 https://blog.jetbrains.com/webstorm/2017/01/debugging-angular-apps/

  • 右击你的package.json,选择Show NPM Scripts
  • NPM工具窗口,点击start脚本启动应用
  • 创建一个新的 JavaScript 调试 配置(运行 -> 编辑配置... -> 添加 -> JavaScript 调试),将http://localhost:4200/ 输入到 URL 字段,按 调试

【讨论】:

  • 最新的 webstorm EAP 在 package.json 中的每个运行条目旁边包括可点击的运行箭头,非常类似于 MAVEN/Gradle
【解决方案2】:

只需打开package.json 并添加您想要的脚本。您可以在"script" 部分添加任何脚本。从配置中添加您的脚本。

【讨论】:

    猜你喜欢
    • 2015-12-06
    • 1970-01-01
    • 1970-01-01
    • 2023-03-06
    • 2014-05-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多