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

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

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

Comments

@julian-schneider
Copy link

julian-schneider commented Jul 24, 2023

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.

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

1 participant