Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

babel-helper-fixtures issue with ESM options #18142

Copy link
Copy link

Description

@birdofpreyru
Issue body actions

Here:

require(suiteOptsLoc),

if the options file is an ESM module, i.e.

export default {
  plugins: [...],
  presets: [...],
};

that require results in the object { default: { plugins: [...], presets: [...] } }; while previously (when the options file was CJS, exporting options like module.exports = { ... }) it would be just the options object { plugins: [...], presets: [...] }, so that breaks everything that depends on that helper. I believe, the same problem is present in other places where require, created via createRequire() is used.

P.S.: So, the actual way I bumped into it was attempting to migrate tests with @babel/helper-plugin-test-runner to full ESM version.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.