【问题标题】:./xxx.scss. Required module not found./xxx.scss。未找到所需模块
【发布时间】:2017-12-01 06:24:02
【问题描述】:

我在运行流检查时遇到了 scss 模块导入问题。我尝试了各种方法,包括

.flowconfig

[options]
module.name_mapper.extension='scss' -> '<PROJECT_ROOT>/flow-typed/stub/css-module.js'

我有

// @flow
type CSSModule = { [key: string]: string }
const emptyCSSModule: CSSModule = {}
export default emptyCSSModule

在 css-module.js 中。你知道为什么会这样吗?

【问题讨论】:

    标签: flowtype


    【解决方案1】:

    我相信我在尝试将 .styl 文件用于触控笔时遇到了类似的问题。

    您也许可以通过执行以下对我有用的操作来解决此问题:

    1. 删除css-module.js 文件。
    2. 删除 .flowconfig 中的 module.name_mapper.extension
    3. 将以下内容添加到 .flowconfig 中的 [options]

    module.file_ext=.js
    module.file_ext=.jsx
    module.file_ext=.json
    module.file_ext=.scss
    

    【讨论】:

      猜你喜欢
      • 2019-05-10
      • 2023-04-01
      • 2017-10-23
      • 2016-09-27
      • 2018-04-15
      • 2020-09-28
      • 2017-03-14
      • 1970-01-01
      • 2019-09-11
      相关资源
      最近更新 更多