简体   繁体   English

aurelia vs2015打字稿框架中缺少“ dist”目录

[英]missing “dist” directory in aurelia vs2015 typescript skeleton

I have downloaded the Aurelia VS2015 skeleton for typescript but am unable to run the Aurelia Navigation app in IIS Express. 我已经下载了Aurelia VS2015框架的打字稿,但是无法在IIS Express中运行Aurelia导航应用程序。 The only change I've made to the skeleton is to add "webroot": "wwwroot", to the top level of project.json. 我对框架所做的唯一更改是在project.json的顶层添加了“ webroot”:“ wwwroot”。

But the app is trying to load "dist/main.js" which has two problems: 1) there is no "dist" directory under "wwwroot" (where it would need to be for IIS Express to find it) nor is there a "dist" directory anywhere else. 但是应用程序正在尝试加载“ dist / main.js”,这有两个问题:1)在“ wwwroot”下没有“ dist”目录(IIS Express需要在该目录中找到它),也没有“ dist”目录在其他任何地方。 The type script files are being compiled to the "src" directory which is sibling to the wwwroot directory and also contains the .ts and .map files which don't belong under wwwroot. 类型脚本文件将被编译到“ src”目录,该目录与wwwroot目录同级,并且还包含不属于wwwroot的.ts和.map文件。

Does anyone know how to fix this issue or where I can find sufficient information to figure it out myself? 有谁知道如何解决此问题,或者我在哪里可以找到足够的信息自己解决这个问题?

Thanks! 谢谢!

great question. 好问题。

In the Visual Studio TypeScript skeleton we supply a configuration option in the tsconfig.json ( https://github.com/aurelia/skeleton-navigation/blob/master/skeleton-typescript-asp.net5/src/skeleton-navigation-typescript-vs/tsconfig.json#L3 ) to not compile on save. 在Visual Studio TypeScript框架中,我们在tsconfig.json中提供了一个配置选项( https://github.com/aurelia/skeleton-navigation/blob/master/skeleton-typescript-asp.net5/src/skeleton-navigation-typescript -vs / tsconfig.json#L3 )保存时不进行编译。

This should work across editors. 这应该适用于所有编辑器。 If it is not picking up the tsconfig.json you could have a few other problems in Visual Studio that are outside of this question. 如果未使用tsconfig.json,则Visual Studio中可能会存在其他一些问题,这些问题不在此范围内。

The other part of the question is about the dist folder - the dist folder gets created as you mentioned when you run gulp build or gulp watch (which runs gulp build under the covers) 问题的另一部分是关于dist文件夹的-如您在运行gulp buildgulp watch (在gulp build运行gulp build )时提到的那样,将创建dist文件夹

If you want to have that be a part of your normal workflow you can follow these steps - 如果您希望将其作为常规工作流程的一部分,则可以按照以下步骤操作-

  1. Open Visual Studio, click View at the top, Other Windows , and click Task Runner Explorer 打开Visual Studio,单击顶部的“ View ”,“ Other Windows ,然后单击“ Task Runner Explorer
  2. You should see a list of the gulp tasks on the left. 您应该在左侧看到gulp任务的列表。 Right click watch and select bindings > project open 右键单击watch并选择bindings > project open

This will keep gulp watch running in the background whenever you have Visual Studio open and are working on the project. 每当您打开Visual Studio并在项目上工作时,这都会使gulp watch在后台运行。

It seems I needed to read the "README.md" provided in the skeleton as it gave an additional required command: "gulp build" that is necessary to get the dist folder and compiled typescript. 似乎我需要阅读框架中提供的“ README.md”,因为它提供了一个附加的必需命令:“ gulp build”,这是获取dist文件夹和编译后的打字稿所必需的。

I would expect that build step to be given in the Visual Studio project configuration, and will need to figure out how to properly integrate it. 我希望在Visual Studio项目配置中给出构建步骤,并且需要弄清楚如何正确地集成它。 Or perhaps I will choose to use the Visual Studio typescript compiler and will be able to tell it to output .js to the dist folder (forgive me, i'm new to a lot of this). 或者,也许我会选择使用Visual Studio打字稿编译器,并能够告诉它将.js输出到dist文件夹(请原谅,我对此并不陌生)。

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

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