Guest User

Untitled

a guest
Oct 18th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. var express = require('express');
  2. var webpack = require('webpack');
  3. var webpackDevMiddleware = require('webpack-dev-middleware');
  4.  
  5. var app = express();
  6. var config = require('./webpack.config.js');
  7. var compiler = webpack(config);
  8.  
  9. // Tell express to use the webpack-dev-middleware and use the webpack.config.js
  10. // configuration file as a base.
  11. app.use(webpackDevMiddleware(compiler, {
  12. publicPath: config.output.publicPath
  13. }));
  14.  
  15. // Serve the files on port 3000.
  16. app.listen(3000, function () {
  17. console.log('Example app listening on port 3000!\n');
  18. });
Add Comment
Please, Sign In to add comment