Skip to content

How do I share code with the browser. #91

Description

@creationix

I'm writing some generic JS logic in a module that I intend to share with my browser implementation of the same app. I've hit a very annoying wall.

In the browser, the only supported way currently to import is full relative file paths. For example in foo.js, I need to load bar.js using:

import bar from "./bar.js"

But on moddable XS, I can only get it to work by doing:

import bar from "bar"

The two platforms are mutually exclusive in their support so I can't share the same source between both.

Why doesn't moddable support the more explicit syntax and/or how can I enable it in my build?

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