Skip to content

Relative import error with namespace #81

Description

@fishen

this is my code:

import { on } from "./event";
export function event(){}
event.on = on;
event.config=function(){}

the bundle result is:

// import error
export function event() : void;
export namespace event {
     var on: typeof import("./event").on;// relative import
     var config: () => void;
}

It’s correct to write another way.

import * as evt from "./event";
export function event(){}
event.on = evt.on;
event.config=function(){}

the bundle result is right:

export function event(): void;
export namespace event {
    var on: typeof evt.on;
    var config: (options: IEventOptions) => void;
}
import * as evt from "packageName/event";

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions