【发布时间】:2018-10-07 19:10:41
【问题描述】:
更新到Create React App 2,通过以下导入语句支持css模块:
import styles from "./myStyles.module.scss";
但是,flow 抱怨说:
Importing from an untyped module makes it any and is not safe!
Did you mean to add // @flow to the top of ./myStyles.module.scss? (untyped-import)
这就是我的.flowconfig 文件中的[options] 的样子:
module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.scss
我也尝试添加以下行:
module.file_ext=.module.scss
【问题讨论】:
-
我认为您根本不希望 flow 处理 .scss 文件。如果您删除 .scss 的
module.file_ext设置,您会得到什么? -
@DaveMeehan 删除该行时,我收到大量流程错误,提示我的所有 scss 文件“无法解析模块”