模块构建失败 - React

时间:2017-08-18 13:13:32

标签: reactjs webpack babel babel-loader

我正在关注一些关于反应的视频教程,现在我已经遇到了这个"模块构建失败错误"。屏幕截图如下所示,一些无效的index.js具有无效的名称'。

请检查它们并帮助我,webpack在视频中显示错误 教程他们没有错误!

//webpack.config.js//

module.exports = {
  entry: './public/app.jsx',
  output: {
    path: __dirname,
    filename: './public/bundle.js'
  },
  resolve: {
 extensions: ['', '.js', '.jsx']
 },
  module: {
loaders: [
  {
    loader: 'babel-loader',
    query: {
      presets: ['react', 'es2015']
    },
    test: /\.jsx?$/,
    exclude: /(node_modules|bower_components)/
      }
    ]
  }
};

//package.json//

{
 "name": "hello-react",
 "version": "1.0.0",
 "description": "simple app\u001b[D\u001b[D\u001b[Dreact app",
 "main": "index.js",
 "scripts": {
  "test": "echo \"Error: no test specified\" && exit 1"
 },
 "author": "Shubham",
 "license": "MIT",
 "dependencies": {
   "express": "^4.15.4",
   "react": "^0.14.7",
   "react-dom": "^0.14.7"
  },
 "devDependencies": {
   "babel-core": "^6.5.1",
   "babel-loader": "^6.2.2",
   "babel-preset-es2015": "^6.5.0",
   "babel-preset-react": "^6.5.0",
   "webpack": "^1.12.13"
 }
}

0 个答案:

没有答案