反応ホットローダーを使用しようとしています。ターミナルで「npm start」コマンドを実行するとエラーが発生します。何が問題なのか教えてください。反応するホットローダーが機能しているのに、ブラウザーで何も起動されないことに苦労しています。
index.js
import 'babel-polyfill';
import React from 'react';
import ReactDOM from "react-dom";
import {createStore} from 'redux'
import {Provider} from 'react-redux'
import allReducers from './reducers'
import App from './Components/App'
import injectTapEventPlugin from 'react-tap-event-plugin';
const store = createStore(allReducers);
injectTapEventPlugin();
ReactDOM.render(
<Provider store = {store}>
<App/>
</Provider>,
document.getElementById('root')
);
webpack.config.js ファイル
var path = require('path');
var webpack = require('webpack');
module.exports = {
devServer: {
inline: true,
contentBase: './src',
port: 3000
},
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./dev/js/index.js'
],
module: {
loaders: [
{
test: /\.js$/,
loaders: ['react-hot', 'babel'],
include: path.join(__dirname, 'src')
},
{
test: /\.scss/,
loader: 'style-loader!css-loader!sass-loader'
}
]
},
output: {
path: path.resolve(__dirname, 'src'),
filename: 'js/bundle.min.js'
},
plugins: [
new webpack.HotModuleReplacementPlugin()
]
};
パッケージ.json
{
"name": "react-redux-template",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"dev": "webpack",
"start": "node server.js"
},
"license": "ISC",
"dependencies": {
"babel-core": "^6.10.4",
"babel-loader": "^6.2.4",
"babel-polyfill": "^6.9.1",
"babel-preset-es2015": "^6.9.0",
"babel-preset-react": "^6.11.1",
"babel-register": "^6.9.0",
"cross-env": "^1.0.8",
"css-loader": "^0.23.1",
"expect": "^1.20.1",
"material-ui": "^0.15.4",
"node-libs-browser": "^1.0.0",
"node-sass": "^3.8.0",
"react": "^15.3.1",
"react-addons-test-utils": "^15.1.0",
"react-dom": "^15.3.1",
"react-redux": "^4.4.5",
"react-tap-event-plugin": "^1.0.0",
"redux": "^3.5.2",
"redux-logger": "^2.6.1",
"redux-promise": "^0.5.3",
"redux-thunk": "^2.1.0",
"sass-loader": "^4.0.0",
"style-loader": "^0.13.1",
"webpack": "^1.13.1",
"webpack-dev-middleware": "^1.6.1",
"webpack-dev-server": "^1.14.1",
"webpack-hot-middleware": "^2.11.0"
},
"devDependencies": {
"babel-plugin-react-transform": "^2.0.2",
"babel-preset-stage-0": "^6.5.0",
"react-hot-loader": "^1.3.0",
"react-transform-hmr": "^1.0.4"
}
}