我是React和Flux的新手,无法弄清楚如何修复下面的错误。加载localhost:8080/app
后,控制台显示cannot find module "./src/index.js"
(有关错误的截图,请参阅this image。)
有人能告诉我我的代码有什么问题吗?这是我的Webpack配置:
module.exports = {
entry:[
"./src/index.js"
],
output: {
path: __dirname,
filename: 'app/js/main.js'
},
module: {
loaders: [
{
test: /\.jsx?$/,
loader: 'babel',
exclude: /node_modules/
}
]
}
}
这是我的package.json
:
{
"name": "react",
"version": "1.0.0",
"description": "get and display user github info",
"main": "react.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "krishna",
"license": "ISC",
"devDependencies":{
"babel-core": "5.8.*",
"babel-loader": "5.3.*",
"webpack": "1.12.*",
},
"dependencies": {
"react":"^0.14.7",
"react-dom":"^0.14.7"
}
}