Lobos / react-ui

A collection of components for React, base on bootstrap 4.0.
http://lobos.github.io/react-ui/
MIT License
1.63k stars 302 forks source link

启动报错:You may need an appropriate loader to handle this file type. #105

Closed liaohongze closed 6 years ago

liaohongze commented 7 years ago

yarn add rctui

// webpack module.exports = { ... externals: {'react': 'React', 'react-dom': 'ReactDOM', 'rctui': 'rctui'}, ... }

// html

// js import { Message } from 'rctui'

// 报错 ERROR in ./node_modules/rctui/Alert.js Module parse failed: D:......\node_modules\rctui\Alert.js Unexpected token (24:48) You may need an appropriate loader to handle this file type. render () { const { children, className, onClose, type, ...others } = this.props const { dismissed } = this.state

@ ./node_modules/rctui/index.js 33:0-42 @ ./app/components/Home/Changepwd.js @ ./app/components/Home/index.js @ ./app/components/Shared/data.js @ ./app/components/Shared/Dashboard.js @ ./app/containers/App.js @ ./app/containers/Root.prod.js @ ./app/containers/Root.js @ ./app/index.js @ multi react-hot-loader/patch webpack-dev-server/client?http://localhost:4000 webpack/hot/only-dev-ser ver ./app/index.js

对于webpack水平有限,请问这个错误要怎么解决?

Lobos commented 7 years ago

webpack 缺配置,可以参考这个项目 https://github.com/Lobos/react-example

longboy commented 7 years ago

这个问题怎么解决的?求分享

liaokunhua commented 6 years ago

我也遇到了,一脸懵哔,不支持扩展语法。。。不知道怎么搞

Lobos commented 6 years ago

写了一个类似 create-react-app 的脚手架,用这个初始化项目吧,https://github.com/Lobos/ogier-react