尝试将RequireJS集成到Typescript项目中 [英] Trying to integrate RequireJS into a Typescript project

查看:426
本文介绍了尝试将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

这篇关于尝试将RequireJS集成到Typescript项目中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆