注意几点:
1、package.json中的依赖react配置的是0.13,手动改成0.14
2、devServer.js 中写死了页面为index.html,董express可以改改
以下是webpack.config.js
var path = require('path'); var webpack = require('webpack'); module.exports = { devtool: 'eval',entry: [ 'webpack-hot-middleware/client','./src/index' ],output: { path: path.join(__dirname,'dist'),filename: 'bundle.js',publicPath: '/static/' },plugins: [ new webpack.HotModuleReplacementPlugin(),new webpack.NoErrorsPlugin() ],module: { loaders: [{ test: /\.js$/,loaders: ['babel'],include: path.join(__dirname,'src') }] } };