Skip to content

Add ESM support for @memlab/api (and remaining) #94

@doteric

Description

@doteric

Hello,

I would like to request the addition of ESM (instead of just commonjs, preferably both should be supported) support.

Currently for example the __filename is used which is not supported inside ESM, additionally the exports require a full import and then destructing the object instead of only importing what's really needed.

Is there any plan to introduce such support in the near future?

Thank you

➖ ➖ ➖ ➖

➕ Another problem that I have spotted

const dir = path_1.default.join(__dirname, "plugins")

inside TestRunnerLoader

After bundling with esbuild this breaks simply because esbuild builds into one file and looking up files inside a directory like that does not work and anyway in the ESM world such approach is not recommended. I would propose a different option of a list of available plugins and import them natively with js instead of using custom file loading. Generally anything using __dirname or similar should be replaced with a import of some sort 😃

I would highly appreciate a fix for the above 🙇

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