【发布时间】:2018-11-10 02:30:16
【问题描述】:
我已经派生了 react-flexbox-grid 以添加对隐藏列的支持(这是我第一次贡献),但我无法将包包含在我的项目中。
根据Docs: Git Urls as Dependencies,我将以下内容放入我的 package.json 中:
"react-flexbox-grid": "falieson/react-flexbox-grid#hidden-columns",
运行 npm i 后,我看到 npm 已获取并且安装包没有错误。
├── react-dom@15.4.1 ├── react-flexbox-grid@0.10.2 (git://github.com/falieson/react-flexbox-grid.git#f8e9e9053430b619f4c7fd79b90ccd4f44d6a05c) ├── react-fontawesome@1.5.0
但是当我启动服务器meteor:webpack抱怨:
./imports/ui/Home/index.jsx 中的错误 找不到模块:错误:无法解析 /Users/falieson/Code/planetx-boilerplate/imports/ui/Home 中的模块“react-flexbox-grid”
我没有更改 index.jsx 上的任何内容
import {Grid, Row, Col} from 'react-flexbox-grid';
{
"css": {
"module": true
},
"module": {
"loaders": [
{
"test": "/\\.css$/",
"loader": "style!css?modules",
"include": "/flexboxgrid/"
}
]
}
}
【问题讨论】:
-
你能分享你的 webpack 配置吗?
-
添加了 webpack 配置,不用担心这个 webpacker 现在是遗留的。我在工作环境中遇到了同样的错误,仍在使用 webpack 1.x,尚未升级到 2.x
标签: node.js meteor webpack open-source