server.js 367 B

123456789101112131415
  1. var webpack = require('webpack');
  2. var WebpackDevServer = require('webpack-dev-server');
  3. var config = require('./webpack.config');
  4. new WebpackDevServer(webpack(config), {
  5. publicPath: config.output.publicPath,
  6. hot: true
  7. }).listen(3000, 'localhost', function (err, result) {
  8. if (err) {
  9. console.log(err);
  10. }
  11. console.log('Listening at localhost:3000');
  12. });