Skip to content
This repository has been archived by the owner on Dec 6, 2017. It is now read-only.

iammerrick/require-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

An AMD loader plugin for TypeScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published