Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to require() #1

Open
Gilead opened this issue Jul 2, 2015 · 0 comments
Open

Unable to require() #1

Gilead opened this issue Jul 2, 2015 · 0 comments

Comments

@Gilead
Copy link

Gilead commented Jul 2, 2015

If I import Ractive like so:

/// <reference path="lib/ractive.d.ts" />
import Ractive = require("lib/ractive");

I get an error in the require(..) line:
File 'path/to/lib/ractive.d.ts' is not an external module.
There are no errors

However if I replace this block:

// used for require()
declare module "ractive" {
    export = Ractive;
}
declare var Ractive: Ractive.Static;

with:

// used for require()
declare var Ractive: Ractive.Static;
export = Ractive;

then it works just fine.

I'm not creating a pull request as I'm not entirely sure if this is the right fix but it seems some changes need to be made to make it work as an external module (or I'm using it the wrong way).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant