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

Relative import error with namespace #81

Open
fishen opened this issue Oct 22, 2019 · 0 comments
Open

Relative import error with namespace #81

fishen opened this issue Oct 22, 2019 · 0 comments

Comments

@fishen
Copy link

fishen commented Oct 22, 2019

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";
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