forked from kobotoolbox/kpi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.test.server.js
54 lines (50 loc) · 1.31 KB
/
webpack.test.server.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// you should not need to edit this file.
// make edits to the corresponding '.config' file
var path = require('path');
var assign = require('react/lib/Object.assign');
var WebpackDevServer = require('webpack-dev-server');
var webpack = require('webpack');
var open = require('open');
var WebpackConfig = require('./helper/webpack-config');
var webpackConfigs = assign(WebpackConfig({
hash: false,
debug: true,
entry: path.resolve(__dirname, 'test', 'index'),
optimize: false,
saveStats: false,
hot: true,
failOnError: true,
outputDir: path.resolve(__dirname, 'test', 'compiled'),
outputHash: false,
devTool: 'eval'
}), {
output: {
path: path.resolve(__dirname, 'test', 'compiled'),
filename: "main.js",
publicPath: 'options.publicPath',
},
entry: [
path.resolve(__dirname, 'test', 'index'),
],
});
var port = webpackConfigs.port || 3000;
var host = webpackConfigs.host || '0.0.0.0';
module.exports = new WebpackDevServer(
webpack(webpackConfigs),
{
inline: true,
colors: true,
quiet: false,
stats: {
cached: false,
cachedAssets: false,
colors: true,
},
}
).listen(port, host, function (err, result) {
if (err) {
console.log(err);
}
console.log('Listening at '+host+':'+port);
open('http://localhost:'+ port +'/test/tests_hot.html');
});