Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. gulp.task('serve', () => {
  2. const config = require('./config/webpack.dev.config');
  3. config.entry.app = [
  4. // this modules required to make HRM working
  5. // it responsible for all this webpack magic
  6. 'webpack-hot-middleware/client?reload=true',
  7. // application entry point
  8. ].concat(paths.entry);
  9.  
  10. var compiler = webpack(config);
  11.  
  12. serve({
  13. port: process.env.PORT || 3000,
  14. open: false,
  15. server: {baseDir: root},
  16. middleware: [
  17. historyApiFallback(),
  18. webpackDevMiddleware(compiler, {
  19. stats: {
  20. colors: colorsSupported,
  21. chunks: false,
  22. modules: false
  23. },
  24. publicPath: config.output.publicPath
  25. }),
  26. webpackHotMiddleware(compiler)
  27. ]
  28. });
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement