Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. const express = require('express');
  2. const app = express();
  3.  
  4. const {NODE_ENV} = process.env;
  5.  
  6. module.exports = function(nodecg) {
  7. if (NODE_ENV !== 'production') {
  8. const webpack = require('webpack');
  9. const webpackConfig = require('../webpack.dev.config');
  10. const devMiddleware = require('webpack-dev-middleware');
  11.  
  12. const compiler = devMiddleware(webpack(webpackConfig), {
  13. publicPath: webpackConfig.output.publicPath,
  14. stats: {colors: true},
  15. log: nodecg.log
  16. });
  17.  
  18. app.use(compiler);
  19. }
  20.  
  21. nodecg.mount(app);
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement