Boa*_*ler 2 typescript asp.net-core
我创建了一个新的空的asp核心项目.我添加了一个简单的ts文件.
现在默认情况下它会自动编译为javascript.
在asp核心之前,项目对话框中有一个选项.但目前的核心解决方案中没有项目对话框.
我也试过这篇文章中描述的内容.所以我添加<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>到xproj文件的firest属性组,但它没有改变任何东西.
前段时间我安装了typescript完整包可能与此相关吗?
关于如何阻止visual studio在核心应用程序中自动打包typescript文件的任何建议?
xProj现在看起来像这样
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<!-- Makes the TypeScript compilation task a no-op -->
<TypeScriptCompileBlocked>true</TypeScriptCompileBlocked>
</PropertyGroup>
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>43a95da8-804b-459b-8082-fdceb957a8d2</ProjectGuid>
<RootNamespace>GulpTs</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup>
<SchemaVersion>2.0</SchemaVersion>
</PropertyGroup>
<ItemGroup>
<DnxInvisibleContent Include="bower.json" />
<DnxInvisibleContent Include=".bowerrc" />
</ItemGroup>
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />
</Project>
Run Code Online (Sandbox Code Playgroud)
编辑你的tsconfig.json并设置compileOnSave为false.
http://www.typescriptlang.org/docs/handbook/tsconfig-json.html
{
"compileOnSave": false,
"compilerOptions": {
"noImplicitAny" : true
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
695 次 |
| 最近记录: |