Skip to content
This repository was archived by the owner on Sep 11, 2018. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions build/webpack-dev-server.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
import webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
import config from '../config';
import webpackConfig from './webpack/development_hot';
import webpack from 'webpack';
import WebpackDevMiddleware from 'webpack-dev-middleware';
import WebpackHotMiddleware from 'webpack-hot-middleware';
import historyApiFallback from 'connect-history-api-fallback';
import express from 'express';
import config from '../config';
import webpackConfig from './webpack/development_hot';

const paths = config.get('utils_paths');
const compiler = webpack(webpackConfig);
const app = express();

const server = new WebpackDevServer(webpack(webpackConfig), {
contentBase : paths.project(config.get('dir_src')),
hot : true,
quiet : false,
noInfo : false,
lazy : false,
stats : {
colors : true
},
historyApiFallback : true
});
app.use(historyApiFallback({
verbose: false
}));

export default server;
app.use(WebpackDevMiddleware(compiler, {
publicPath: webpackConfig.output.publicPath,
contentBase: paths.project(config.get('dir_src')),
hot: true,
quiet: false,
noInfo: false,
lazy: false,
stats: {
colors: true
}
}));

app.use(WebpackHotMiddleware(compiler));

export default app;
2 changes: 1 addition & 1 deletion build/webpack/development_hot.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import config from '../../config';
import webpackConfig from './development';

webpackConfig.entry.app.push(
`webpack-dev-server/client?${config.get('webpack_public_path')}`,
`webpack-hot-middleware/client?path=/__webpack_hmr`,
`webpack/hot/dev-server`
);

Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@
"babel-plugin-react-transform": "^1.1.0",
"babel-runtime": "^5.8.20",
"chai-as-promised": "^5.1.0",
"connect-history-api-fallback": "^1.1.0",
"css-loader": "^0.23.0",
"eslint": "^1.0.0",
"eslint-config-airbnb": "^1.0.0",
"eslint-plugin-react": "^3.3.1",
"express": "^4.13.3",
"extract-text-webpack-plugin": "^0.9.0",
"file-loader": "^0.8.4",
"html-webpack-plugin": "^1.6.1",
Expand Down Expand Up @@ -76,6 +78,7 @@
"style-loader": "^0.13.0",
"url-loader": "^0.5.6",
"webpack": "^1.11.0",
"webpack-dev-server": "^1.10.1"
"webpack-dev-middleware": "^1.4.0",
"webpack-hot-middleware": "^2.5.0"
}
}