forked from react-boilerplate/react-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.prod.js
More file actions
24 lines (21 loc) · 737 Bytes
/
server.prod.js
File metadata and controls
24 lines (21 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Gets called when running npm run serve
var webpack = require('webpack');
var WebpackDevServer = require('webpack-dev-server');
var config = require('./webpack.prod.config');
var ip = require("ip");
console.log('Starting server from build folder...\n');
new WebpackDevServer(webpack(config), { // Start a server
publicPath: config.output.publicPath,
filename: "bundle.js",
contentBase: 'build',
lazy: true,
historyApiFallback: true,
quiet: true // Without logging
}).listen(3000, '0.0.0.0', function (err, result) {
if (err) {
console.log(err);
} else {
console.log('Server started');
console.log('Your app is available at http://' + ip.address() + ':3000 on any device in your local network!');
}
});