Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

An AMD loader plugin for TypeScript

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 build
Octocat-spinner-32 example
Octocat-spinner-32 src
Octocat-spinner-32 vendor
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .gitmodules
Octocat-spinner-32 README.md
Octocat-spinner-32 grunt.js
Octocat-spinner-32 package.json
README.md

require-ts

require-ts is a Require.js plugin that allows you to require TypeScript dependencies into your project.

Download

Usage

You leverage require-ts like any other require.js plugin! Simply place "ts!" before your dependency path, make sure to leave off the file extension.

define(['ts!a/typescript/dep'], function(dep) {
  // dep is compiled to JS at this point.
});

You can also see the "example" folder, where require-ts is being used to run the Microsoft provided greeter sample.

Type Declarations

You can load in TypeScript type declaration files by adding some configuration to your require.js configuration. Ultimately a a string of the source needs to be passed into the compiler and for the time being you can use the text! plugin.

requirejs.config({
  ts: {
    declarations: [
      'text!../vendor/typescript/bin/lib.d.ts',
      'text!../vendor/typescript/bin/jquery.d.ts'
    ]
  }
});

Build

npm install && grunt build

Implementation Details

This project leverages git submodules to embed the TypeScript project. This allows us to automate the build for a new version of the plugin as the TypeScript project moves forward. We leverage grunt and rigger to build the plugin.

Author

Credits

The text loading mechanisms is extracted from require-cs, the work done by James Burke.

License

Available via the MIT or new BSD license.

Something went wrong with that request. Please try again.