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

support simple dynamic paths in dynamic imports #342

Open
ju1ius opened this issue Nov 6, 2023 · 0 comments
Open

support simple dynamic paths in dynamic imports #342

ju1ius opened this issue Nov 6, 2023 · 0 comments

Comments

@ju1ius
Copy link

ju1ius commented Nov 6, 2023

Hi,

This is a follow-up to #216.

Currently transforming the following:

const getCommand = async (name: string): Command =>
  (await import(`./commands/${name}.ts`)).default

yields the following result:

const getCommand = async (name) =>
  (await import(`./commands/${name}.ts`)).default

While I understand full support for dynamic paths is unsolvable, could the transformer support simple cases like this (either by inspecting the argument's AST or via a special annotation like webpack does) ?

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