Skip to content

Improve docs around external helpers #299

Description

@ItamarGronich

When you set "externalHelpers": true, SWC will inject ESM style imports for helpers by default.

It can be a problem when using commonjs modules. SWC will end up still injecting an ESM import and then you'd have a module with mixed import syntax.

This can cause many problems down the road.

For instance what i ran into was that since the injected import is at the top, Rspack thought that my commonjs module is actually an ESM module because the first import statement was esm (which was injected by swc).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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