File size: 477 Bytes
d86254c c8e4236 c766f4e d86254c 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 |
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const opn = require('opn');
const config = require('./webpack.config.dev');
const PORT = 3000;
const HOST = 'localhost';
const URL = `http://${HOST}:${PORT}`;
new WebpackDevServer(webpack(config), {
publicPath: config.output.publicPath,
}).listen(PORT, HOST, (error, result) => {
if (error) {
console.error(error);
}
opn(URL);
console.log(`Listening at ${URL}`);
});
|