facebook / facebook/flow

module.name_mapper to map absolute import paths no longer works

未關閉
#3,189 5 則留言 7 個 reaction 已指派 0 人 在 GitHub 檢視
module resolution
主要語言
Rust
星號
22.3k
分支
1.9k
PR 合併指標
30 天內沒有已合併 PR

描述

This .flowconfig:

```
[options]
module.system=haste
module.name_mapper='^\/\(.*\)$' -> '/src/\1'
```

used to make imports like this work:

`import Header from '/components/Header'`

Now the above setup results in errors:

```
src/components/App.jsx:5
5: import Header from '/components/Header'
^^^^^^^^^^^^^^^^^^^^ /components/Header. Required module not found

Found 1 error
```

Changing the prefix away from `/` to anything else results in the same error.

Also, in order to debug this more, is there any way to ask Flow to be more verbose about exactly where it's looking for modules?

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。