Skip to content

es6-global can't resolve external node modules as URI #2118

@yyc-git

Description

@yyc-git

build this code:

external createSandbox : unit => Js.t {..} = "create" [@@bs.scope "sandbox"] [@@bs.module "sinon"];

expect to genearte:

import * as Sinon                  from "../../node_modules/sinon";

but actual to generate:

/*
wrong:
 import * as Sinon                  from "sinon"; 
*/

/* fixed */
import * as Sinon  from "../../node_modules/sinon/dist/sinon.js"

refer to #1193:

how to know the path of external JS library, currently we leave it as it
Implementation details:
we might need have a global view of dependencies and pass a package map unlike current implementation which did lots of path calculation

can @bobzhang fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions