File size: 507 Bytes
d86254c
 
 
 
3f0c832
c766f4e
d86254c
 
a98e9c8
d86254c
 
c766f4e
 
 
 
3f0c832
c766f4e
d86254c
c766f4e
 
d86254c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const opn = require('opn');

const config = require('./config/webpack.config.demo');

const PORT = 3000;
const HOST = 'localhost';
const URL = `http://${HOST}:${PORT}/dist/demo`;

new WebpackDevServer(webpack(config), {
  publicPath: config.output.publicPath,
}).listen(PORT, HOST, (error, result) => {
  if (error) {
    console.error(error);
    return;
  }

  opn(URL);
  console.log(`Listening at ${URL}`);
});