How does the module checker in Visual Studio know the requirejs root directory?

Topics: General
Oct 3, 2012 at 1:51 AM

VS2010 seems to be complaining about module dependency resolutions.  My .ts file is in a subdirectory and I'm declaring a dependency on a module file off the requirejs module root.

I don't see how the VS addin knows about the module loading logic to resolve the location of the module.  How are these compatible?

Oct 4, 2012 at 12:06 AM

I believe section 9.4 of the language specification outlines how external module names are resolved.  If this doesn't answer your question, please post back.  If you believe there is an issue with name resolution, please post it in the 'Issue Tracker' section.  Thanks!

Oct 4, 2012 at 1:24 AM

I read that - but it doesn't seem to account for a configured require.js script root.  If you set a special dir in the require.js configuration how does TypeScript know about it without running it? Visual Studio seems to complain, for example.

Oct 4, 2012 at 4:53 AM

Correct.  For this initial release, we know nothing about any specific configuration you may provide to require.js, and the algorithm used isn't settable.  We just do basic path parsing on the string provided.

Oct 4, 2012 at 9:30 AM

It definitely needs to support requirejs config files -- without this it's extremely difficult to start using it in real-world apps. I have such app that is already built with RequireJS and I wanted to incorporate the TypeScript step by step. But this seems impossible for now :(

Jan 8, 2013 at 2:04 PM

yes, same here. without taking the require.js config into account it's useless for real applications, at least for me.