Trying to integrate RequireJS into a Typescript project

本秂侑毒 提交于 2019-12-13 03:59:37

问题


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'.

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

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.


回答1:


As ryan mentioned the command should be :

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

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



来源:https://stackoverflow.com/questions/20592191/trying-to-integrate-requirejs-into-a-typescript-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!