-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstart-dev-server.js
30 lines (27 loc) · 943 Bytes
/
start-dev-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
var WebpackDevServer = require("webpack-dev-server");
var path = require("path");
var webpack = require("webpack");
var webpackConfig = require("./webpack.config.js");
var myConfig = Object.create(webpackConfig);
myConfig.devtool = "eval";
myConfig.debug = true;
myConfig.entry['bundle.js'].unshift("webpack-dev-server/client?http://localhost:3000");
var server = new WebpackDevServer(webpack(myConfig), {
//publicPath: "/" + myConfig.output.path,
contentBase: 'public/',
inline: true,
stats: {
colors: true
}
});
server.listen(3000, "localhost", function(err) {
if(err) {
console.log('An error has occured');
console.log(err);
}
console.log('Server Listenting at http://localhost:3000');
});
// .listen(3000, "localhost", function(err) {
// if (err) // throw some sort of error throw new gutil.PluginError("webpack-dev-server", err);
// //good stuff started to listen
// });