Skip to content

Default loader logic completely ignores Loader API #3

@mbullington

Description

@mbullington

Description

The bug comes from this line:

const loader = JS_EXTENSIONS.has(extension) ? 'jsx' : extension;

This completely ignores the https://esbuild.github.io/api/#loader API, for example in your ESBuild config if you were to do ".css": "text" this wouldn't work.

Solutions

Not sure how hard it would be, but ideally we'd check the Loader API options here.

An alternative approach would be to change the default filter so this plugin only runs on JS/JSX/TS/TSX files.

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