dnt icon indicating copy to clipboard operation
dnt copied to clipboard

support simple dynamic paths in dynamic imports

Open ju1ius opened this issue 1 year ago • 0 comments

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) ?

ju1ius avatar Nov 06 '23 21:11 ju1ius