Skip to content

Allow dynamically importing .js files, without explicitly giving the file extension #7

Open
@julian-schneider

Description

Since the .js file extension is frequently omitted in import statements, it would be nice if this plugin supported this.

As an example for this requirement, I currently need to bundle Elastic UI with my module. Their code base contains this dynamic import. More precisely, during the bundling process, the equivalent line 102 in their distribution is included. (Note that the use of simple string concatenation instead of template strings is discussed in #8.)

By adding an empty string to the transformExtensions parameter, this plugin recognizes Elastic UI's dynamic import statement and adds the target files to the produced ImportMap, but the ImportMap only contains keys with the file extension.

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