Geeks With Blogs

News Please visit me at my new blog!!

profile for Aligned at Stack Overflow, Q&A for professional and enthusiast programmers
"free in Christ Jesus from the law of sin and death." Romans 8:2 (ESV) Check out the Falling Plates video on YouTube.
more about the Gospel
And then listen to Francis Chan speaking at LifeLight in SD.



Programming and Learning from SD

I found this out the hard way the other day. We’re using TypeScript and RequireJS for development. There’s a nice way to ensure the file has a dependency, without having to import it. Put the comment at the top of you file.

/// <amd-dependency path="knockout-es5"/>

I found that this needs to be at the very top or Require won’t pull in the file. I unsuspectingly added “use strict”; and it stopped working. After awhile, we moved it below and it worked.

Invalid:
“use strict”;
/// <amd-dependency path="knockout-es5"/>
Works:
/// <amd-dependency path="knockout-es5"/>
"use strict";
import $ = require('jquery');
class PageViewModel{

}
export = PageViewModel;
Posted on Friday, January 30, 2015 3:45 PM TypeScript , RequireJS | Back to top


Comments on this post: Order matters with AMD-Dependency, TypeScript and use strict

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © Aligned | Powered by: GeeksWithBlogs.net