尝试将RequireJS集成到Typescript项目中

问题描述:

我正在尝试将RequireJS添加到我的Typescript + JQuery项目中,为此我需要使用我无法执行的AMD选项来编译我的Typescript文件.这是webstorm中的控制台输出.

I am trying to add RequireJS to my Typescript + JQuery project, for which I need to compile my typescript file with the AMD option which I am not able to do. Here's the console output in webstorm.

C:/Users/Me/AppData/Roaming/npm/tsc.cmd --sourcemap config.ts --module commonjs --module AMD main.ts
error TS5007: Cannot resolve referenced file: 'main.ts'.

我正在尝试按照绝对键入"中的说明进行操作. https://github.com/borisyankov/DefinitelyTyped/tree/master/requirejs

I am trying to follow the instructions on "Definitely Typed". https://github.com/borisyankov/DefinitelyTyped/tree/master/requirejs.

我猜想该项目有望编译成单个文件"main.ts",该文件将转换为JS.但这似乎没有发生.

I guess the project is expected to compile into a single file "main.ts" which would be converted to JS. But that doesn't seem to be happening.

正如ryan所提到的,命令应为:

As ryan mentioned the command should be :

--sourcemap config.ts --module amd main.ts

要了解如何在TypeScript世界中配置requirejs,请参见: http ://www.youtube.com/watch?v = 4AGQpv0MKsA& hd = 1

To see how you can configure requirejs in TypeScript world have a look at : http://www.youtube.com/watch?v=4AGQpv0MKsA&hd=1