我做了以下步骤:
- 下载了 Aurelia WebPack 2 typescript 框架。
- 通过运行
yarn install
安装了所有节点模块。 - 在 Visual Studio 2017 中打开项目文件夹。
- Task Runner 找到
package.json
,我可以成功启动任务
现在我不知道如何启动应用程序并告诉 Visual Studio 2017 对其进行调试。
请帮忙。
更新 这是我在调试菜单中看到的:
最佳答案
将以下突出显示的行和 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/