Skip to content

manual import via doit doesn't work for non-packages #33

Description

@rksm

When evaluating an import statement such as import { h } from "virtual-dom"; from a module that is not contained inside a lively package, the import will not resolve the module correctly, i.e. h in the example will be undefined.

Config code:

"systemjs": {
    "map": {"virtual-dom": "./node_modules/virtual-dom/dist/virtual-dom.js"},
    "meta": {"node_modules/virtual-dom/dist/virtual-dom.js": {"format": "amd"}}
}

It seems that the import statement doesn't use the parent module for lookup:
await System.normalize("virtual-dom") => http://localhost:9001/virtual-dom
vs.
await System.normalize("virtual-dom", lively.modules.module("lively.morphic/index.js").id) => http://localhost:9001/node_modules/lively.morphic/node_modules/virtual-dom/dist/virtual-dom.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions