denoland / denoland/dnt

support simple dynamic paths in dynamic imports

Open
#342 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
1.3k
Forks
49
PR merge metrics
No merged PRs in 30d

Description

Hi,

This is a follow-up to #216.

Currently transforming the following:
```ts
const getCommand = async (name: string): Command =>
(await import(`./commands/${name}.ts`)).default
```
yields the following result:
```js
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) ?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.