dnt
dnt copied to clipboard
support simple dynamic paths in dynamic imports
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) ?