0

The standard module import syntax in TypeScript,

import foo = require('foo');

requires you to bind a new identifier to the imported module. But in some cases I just want to express a dependency without binding anything. For example, if I'm depending on a jQuery plugin that doesn't actually export things, it just adds new fields to jQuery itself. Is there a way to do something like

require('foo');

without the import part?

1 Answer 1

3

You can use the undocumented amd-dependency flag :

/// <amd-dependency path="foo"/>

Additional information (slightly dated video) : http://www.youtube.com/watch?v=4AGQpv0MKsA&hd=1

Sign up to request clarification or add additional context in comments.

1 Comment

thanks for your help, here's my latest TypeScript question if you're interested: stackoverflow.com/questions/20140752/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.