打字稿一直编译文件名并将文件名更改为小写(VS2015)
Typescript compiling and changing filenames to lowercase all the time (VS2015)
我正在使用最新的 VS2015,在我的打字稿项目文件中设置了以下选项:
<PropertyGroup>
<TypeScriptTarget>ES5</TypeScriptTarget>
<TypeScriptCompileOnSaveEnabled>true</TypeScriptCompileOnSaveEnabled>
<TypeScriptNoImplicitAny>false</TypeScriptNoImplicitAny>
<TypeScriptModuleKind>AMD</TypeScriptModuleKind>
<TypeScriptRemoveComments>false</TypeScriptRemoveComments>
<TypeScriptOutFile></TypeScriptOutFile>
<TypeScriptOutDir></TypeScriptOutDir>
<TypeScriptGeneratesDeclarations>false</TypeScriptGeneratesDeclarations>
<TypeScriptSourceMap>true</TypeScriptSourceMap>
<TypeScriptMapRoot></TypeScriptMapRoot>
<TypeScriptSourceRoot></TypeScriptSourceRoot>
<TypeScriptNoEmitOnError>true</TypeScriptNoEmitOnError>
</PropertyGroup>
我的问题是编译文件时:
UserService.ts it creates a userservice.js and a userservice.js.map
然后包含 //# sourceMappingURL=userservice.js.map
然后 userservice.js.map 有这一行:
sources":["userservice.ts"]
还有其他人看过吗?我试过重新创建文件和相同的。这给我带来了很多问题。
跟进:
当我创建一个 typescript 文件时 UserServicexxxx.ts 一切正常。当我删除所有 UserService 文件并创建一个 UserService.ts 时,它会返回执行之前的操作。
我已经努力了 30 分钟或更长时间,试图创建 UserService.ts、UserService.js 和 UserService.js.map :-(
这个问题的原因可能是:https://github.com/Microsoft/TypeScript/issues/2011
您是否检查过您从中引用 UserService.ts 的所有文件的大小写是否正确?如果它们的大小写为 userservice.ts,它将编译为 userservice.js,而不管 ts 文件的实际大小写。出于性能原因,他们现在不检查这个,但它会产生像这样的奇怪错误。
清理您的项目并搜索 'userservice.ts'。如果找到,请将大小写更改为正确的 CamelCasing 并重新编译。
我在这里重现了这个问题:
UserService.ts
userService.ts
userservice.ts
检查额外是否有任何延迟链接!
我正在使用最新的 VS2015,在我的打字稿项目文件中设置了以下选项:
<PropertyGroup>
<TypeScriptTarget>ES5</TypeScriptTarget>
<TypeScriptCompileOnSaveEnabled>true</TypeScriptCompileOnSaveEnabled>
<TypeScriptNoImplicitAny>false</TypeScriptNoImplicitAny>
<TypeScriptModuleKind>AMD</TypeScriptModuleKind>
<TypeScriptRemoveComments>false</TypeScriptRemoveComments>
<TypeScriptOutFile></TypeScriptOutFile>
<TypeScriptOutDir></TypeScriptOutDir>
<TypeScriptGeneratesDeclarations>false</TypeScriptGeneratesDeclarations>
<TypeScriptSourceMap>true</TypeScriptSourceMap>
<TypeScriptMapRoot></TypeScriptMapRoot>
<TypeScriptSourceRoot></TypeScriptSourceRoot>
<TypeScriptNoEmitOnError>true</TypeScriptNoEmitOnError>
</PropertyGroup>
我的问题是编译文件时:
UserService.ts it creates a userservice.js and a userservice.js.map
然后包含 //# sourceMappingURL=userservice.js.map
然后 userservice.js.map 有这一行:
sources":["userservice.ts"]
还有其他人看过吗?我试过重新创建文件和相同的。这给我带来了很多问题。
跟进:
当我创建一个 typescript 文件时 UserServicexxxx.ts 一切正常。当我删除所有 UserService 文件并创建一个 UserService.ts 时,它会返回执行之前的操作。
我已经努力了 30 分钟或更长时间,试图创建 UserService.ts、UserService.js 和 UserService.js.map :-(
这个问题的原因可能是:https://github.com/Microsoft/TypeScript/issues/2011
您是否检查过您从中引用 UserService.ts 的所有文件的大小写是否正确?如果它们的大小写为 userservice.ts,它将编译为 userservice.js,而不管 ts 文件的实际大小写。出于性能原因,他们现在不检查这个,但它会产生像这样的奇怪错误。
清理您的项目并搜索 'userservice.ts'。如果找到,请将大小写更改为正确的 CamelCasing 并重新编译。
我在这里重现了这个问题:
UserService.ts
userService.ts
userservice.ts
检查额外是否有任何延迟链接!