简体   繁体   English

Typescript编译器错误重命名javascript文件

[英]Typescript compiler bug renaming javascript file

I have a reference to this module found here: 我在这里找到此模块的参考:

https://github.com/basarat/typescript-collections https://github.com/basarat/typescript-collections

And I reference it in my typescript projects like this: 我在这样的打字稿项目中引用了它:

///<reference path='..\..\libs\collections.ts'/>

I use grunt to compile the project: 我用grunt编译项目:

    typescript: {
        server: {
            src: ['src/server/**/*.ts'],
            dest: ['bin/server'],
            options: {
                module: 'commonjs',
                base_path: 'src/server',
                target: 'es5'
            }
        }
    }

Anyway, for some reason the compiler is outputting the file as either ctions.js or lections.js , as though its truncating the name somehow. 无论如何,由于某种原因,编译器会将文件输出为ctions.jslections.js ,好像它以某种方式截断了名称一样。

Any ideas? 有任何想法吗?

EDIT 编辑

Ok so after some experimentation, I renamed the module to "testing" and the name gets truncated to ng.js. 好的,经过一些试验,我将模块重命名为“ testing”,并且名称被截断为ng.js。 It seems that something within this module is modifying the output file name. 似乎此模块中的某些内容正在修改输出文件名。

It looks like a grunt problem. 看来是个咕unt的问题。 Try compiling with tsc manually or check out grunt-ts : https://npmjs.org/package/grunt-ts 尝试手动使用tsc编译,或查看grunt-ts: https : //npmjs.org/package/grunt-ts

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

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