问题
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