在运行如下所示的react项目时,我遇到了webpack编译错误:
ERROR in ./src/dispatcher-dev/App.js 17:20
Module parse failed: Unexpected token (17:20)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| class App extends Component {
> componentDidMount = () => {
| // Check the type of browser and add a class accordingly to the body
| let browser = (function(){
@ ./src/dispatcher-dev/index.js 7:0-24 10:36-39
@ multi ./src/dispatcher-dev/index.js
我已经将babel-loader
包括在我的Webpack中,还包括了react-dom
和prop-types
。
有人可以帮助我吗?