Skip to content

Handle dynamic imports with simple string concatenation instead of template strings #8

Open
@julian-schneider

Description

This plugin currently does not support dynamic import statements comprised of string concatenation instead of template strings.

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 missing .js file extension is discussed in #7.)

It would be nice if there was an option that allows parsing simple string concatenations. But precautions must be taken so that the plugin does not damage lines that are not actually dynamic imports, such as this one.

A starting point to achieve this may be using ESLint's prefer-template rule and the --fix command line option as a preprocessing step that transforms string concatenations to template strings.

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