debugging - 在 VS2017 中调试 Aurelia webpack typescript 应用程序

标签 debugging typescript webpack aurelia visual-studio-2017

我做了以下步骤:

  1. 下载了 Aurelia WebPack 2 typescript 框架。
  2. 通过运行 yarn install 安装了所有节点模块。
  3. 在 Visual Studio 2017 中打开项目文件夹。
  4. Task Runner 找到package.json,我可以成功启动任务

现在我不知道如何启动应用程序并告诉 Visual Studio 2017 对其进行调试。

请帮忙。

更新 这是我在调试菜单中看到的:

enter image description here

最佳答案

将以下突出显示的行和 RunWebPack 目标添加到我的 .csproj 文件中:

<PropertyGroup>
  <TargetFramework>netcoreapp1.1</TargetFramework>
  <TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
  <IsPackable>false</IsPackable>
</PropertyGroup>

<Target Name="RunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in  
production mode -->
  <Exec Command="npm install" />
  <Exec Command="node node_modules/webpack/bin/webpack.js --config 
webpack.config.vendor.js --env.prod" />
  <Exec Command="node node_modules/webpack/bin/webpack.js --env.prod" />

  <!-- Include the newly-built files in the publish output -->
  <ItemGroup>
    <DistFiles Include="wwwroot\dist\**" />
    <ResolvedFileToPublish Include="@(DistFiles->'%(FullPath)')" 
Exclude="@(ResolvedFileToPublish)">
      <RelativePath>%(DistFiles.Identity)</RelativePath>
      <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
    </ResolvedFileToPublish>
  </ItemGroup>
</Target>

同时在调试期间打开 Modules 窗口,并检查它是否有关于哪些符号遇到此问题的更详细信息。

请同时在>ToolS->Options->Debugging下启用Microsoft Symbol Servers,再次调试。

关于debugging - 在 VS2017 中调试 Aurelia webpack typescript 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43397846/

相关文章:

reactjs - 如何在 ReactJS 中使用 mobx 组织 typescript

reactjs - Webpack/Babel/React 构建错误 : "Unknown option: foo/node_modules/react/react.js.Children"

java - Eclipse 调试器 "jumps"跳过重要代码

.net - 是什么让 CLR 显示断言?

angular - 警报 Controller 输入框验证

ruby-on-rails - Rails/Webpacker 未在生产中加载 Vue 样式

image - 使用 Webpack 在 React 中加载图像

Python Flask 蓝图 - 导入错误 : cannot import name app

debugging - 是否可以在即时窗口中执行汇编语言指令

angular - Typescript 中的私有(private)参数