Skip to content

typescriptlibs/amd

Repository files navigation

AMD: TypeScript AMD Loader

This package provides the necessary functions to load and run a TypeScript AMD bundle as created by the outFile option of a tsconfig.json.

It does not support loading of external files. Each external dependency must also be created as a TypeScript AMD bundle instead.

CodeQL Node.js npm license

Example

// MyBundle.ts
export function hello () {
    alert( 'Hello, world!' );
}
<!-- my-app.html -->
<html lang="en">
    <head>
        <script src="amd.js"></script>
        <script src="my-ts-amd-bundle.js" async></script>
        <script>
            window.addEventListener( 'load', () => require('MyBundle').hello() );
        </script>
    </head>
    <body>
    </body>
</html>