Skip to content

The first occurence of extension is replaced with empty string, not the actual extension #78

Description

@ks-ieremenko

In my case, highlight.js library is used, and the import like this: highlight.js/languages/javascript results in hightlight/languages/javascript (the wrong extension is erased). Then, in case statements, there are 2 possible options: highlight.js/languages/javascript.js and highlight/languages/javascript.js.js.

I found the problem in utils.ts file: importee.replace(ext, '') replaces the first occurrence. I would suggest using something like ext && importee.endsWith(ext) ? importee.slice(0, -ext.length) : importee.

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