每当我在终端运行 webpack
时,我得到:
Hash: efea76b1048c3a97b963
Version: webpack 1.12.13
Time: 33ms
+ 1 hidden modules
ERROR in Cannot find module 'babel-core'
这是我的 Webpack.config.js文件
module.exports = {
entry: './app-client.js',
output: {
filename: 'public/bundle.js'
},
module: {
loaders: [
{
exclude: /(node_modules|app-server.js)/,
loader: 'babel'
}
]
}
}
包裹 Json
{
"name": "react",
"version": "1.0.0",
"description": "React polling app",
"main": "app-client.js",
"dependencies": {
"babel-loader": "^6.2.2",
"bootstrap": "^3.3.6",
"express": "^4.13.4",
"react": "^0.14.7"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}