Skip to content

Unable to require() #1

@ghost

Description

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions