0

我正在关注一些关于反应的视频教程,现在我被这个“模块构建失败错误”困住了。下面提供了屏幕截图,一些无效的 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"
 }
}
4

0 回答 0