Lobos/react-ui

使用react-ui过程中一直报错:You may need an appropriate loader to handle this file type.

lyc94230 opened this issue · 4 comments

我是使用create-react-app自动创建的项目,在使用react-ui的过程中,一直提示报错:
./node_modules/rctui/Button.js
Module parse failed: D:\workspace\web\branches\test\app_huiyiabc\huiyi\source\web\node_modules\rctui\Button.js Unexpected token (31:56)
You may need an appropriate loader to handle this file type.
|
| render () {
| let { children, status, size, grid, tag, className, ...others } = this.props
|
| className = classnames(
Compiling...
Compiled with warnings.

我找到另一份作者的创建整个项目的说明文档,对比了一下所有要安装的模块,发现那些loader我都有安装,但是就是一直不能使用,报同一个错误。我想请问一下这个是什么问题,我该怎么解决呢?我要是刚开始接触react,不是很理解。谢谢!

Lobos commented

应该是webpack 配置问题,参考一下这个项目 https://github.com/Lobos/react-example

首先谢谢你给我回复!但是我那个是create-react-app自动创建的项目,那个webpack配置文件好像被封装了,是必须要在webpack中配置吗?

Lobos commented

配置文件应该在config目录下面,要修改一下,不然webpack没法知道使用哪个loader

我也遇到这种问题,怎么解决的?