forked from shakacode/react-webpack-rails-tutorial
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver-rails-hot.js
35 lines (29 loc) · 830 Bytes
/
server-rails-hot.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* eslint no-var: 0, no-console: 0 */
import webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
import webpackConfig from './webpack.client.rails.hot.config';
const hotRailsPort = process.env.HOT_RAILS_PORT || 3500;
const compiler = webpack(webpackConfig);
const devServer = new WebpackDevServer(compiler, {
contentBase: `http://lvh.me:${hotRailsPort}`,
publicPath: webpackConfig.output.publicPath,
hot: true,
inline: true,
historyApiFallback: true,
quiet: false,
noInfo: false,
lazy: false,
stats: {
colors: true,
hash: false,
version: false,
chunks: false,
children: false,
},
});
devServer.listen(3500, 'localhost', err => {
if (err) console.error(err);
console.log(
`=> 🔥 Webpack development server is running on port ${hotRailsPort}`
);
});