小编Jar*_*vis的帖子

反应:流程:导入本地js文件-无法解决问题模块

我正在使用Flow:用于响应前端应用程序的静态类型检查库,对于从src目录进行内部导入,它会抛出“无法解析”:

Example in file at path: src/abc/def/ghi/hello.jsx, I am using the following import:
import words from '../words';

--> Throws error "Cannot resolve module ../words

words.js is in src/abc/def dir
Run Code Online (Sandbox Code Playgroud)

编辑: 安装流类型后,我的.flowconfig看起来像这样:

[ignore]
.*/node_modules/.*
.*/build/.*
.*/dist/.*


[include]
.*/src/.*
.*/test/.*

[libs]
flow-typed

[lints]

[options]
all=true
module.system.node.resolve_dirname=node_modules
module.system.node.resolve_dirname=src

[strict]
Run Code Online (Sandbox Code Playgroud)

如何在.flowconfig文件中映射此类导入的流?

提前致谢。

javascript reactjs flowtype react-native flow-typed

5
推荐指数
1
解决办法
1592
查看次数

标签 统计

flow-typed ×1

flowtype ×1

javascript ×1

react-native ×1

reactjs ×1