This project is read-only.

RequireJS - How to start?

Topics: General
Oct 23, 2012 at 9:20 PM

Hello, I'm struggling with starting requirejs.

I have an module exported which I want to start when my page runs:

export module bootstrapper {
    export function run(): void {

But how do I start this? In an JS example I do the following:

(function() {

    function load() {
        requirejs([], boot);

    function boot() {
        require(['bootstrapper'], function(bs) {; });

But obviously this does not work, because "requirejs" and "require" is not know. Can anyone help me with my starting problems?

Oct 24, 2012 at 2:50 PM

I've just blogged about how to use require.js and AMD modules with TypeScript.  The tutorial is a walkthrough from a standard commonJS Greeter application through AMD to require.js and using require.config.

Hope this helps.


Oct 24, 2012 at 3:40 PM

I found your blog and I had problems with it. I added a comment, which you either did not allowed, or simply deleted..

Oct 24, 2012 at 3:52 PM

Hey Somebody,

Yes, I deleted the comment.  If you would like your comments to be taken seriously next time, then please don't use as an e-mail address.  It is marked as spam immediately and ignored.

I have worked through the contents of the blog several times, and have also provided the full source download as reference - so when you say it doesn't work - please be more specific.

Oct 24, 2012 at 4:10 PM

It's interesting that you don't take comments seriously just because of an invalid email (did I really use that? it's usually, no matter what the actual content of the comment is. Most people don't want their emails spread out, and having this as a requirement for comments leads to emails like that.

I'll post the error again when I'm at home and can reproduce it again.