Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
julian-schneider opened this issue Jul 24, 2023 · 2 comments

Comments

@julian-schneider
Copy link

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.

@kalvenschraut
Copy link
Member

Hey, been a bit busy.

I have been thinking that this plugin should use an AST tool to find the imports instead of regex which should resolve this issue. Will look into this during the upcoming weekend,. along with your other opened issue.

@graham-atom
Copy link

any news on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants