Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'use strict';
var express = require('express');
var webpack = require('webpack');
var webpackDevMiddleware = require('webpack-dev-middleware');
var webpackHotMiddleware = require('webpack-hot-middleware');
var hopsConfig = require('hops-config');
var hopsBuildConfig = require('hops-build-config');
var hopsExpressUtils = require('hops-express').utils;
var createMiddleware = require('./middleware');
var cleanup = require('./cleanup');
var developConfig = hopsBuildConfig.develop;
var nodeConfig = hopsBuildConfig.node;
process.on('unhandledRejection', function(error) {
throw error;
});
function runDevelop(options, callback) {
var compiler = webpack(developConfig);
var app = express();
app.use(hopsExpressUtils.timings);
app.use(
'use strict';
var events = require('events');
var express = require('express');
var mocks = require('node-mocks-http');
var hopsConfig = require('hops-config');
var hopsExpressUtils = require('hops-express').utils;
var createMiddleware = require('./middleware');
module.exports = function createRenderer(webpackConfig, watchOptions) {
var router = new express.Router();
router.use(hopsExpressUtils.timings);
hopsExpressUtils.bootstrap(router, hopsConfig);
hopsExpressUtils.registerMiddleware(
router,
createMiddleware(webpackConfig, watchOptions)
);
return function(options) {
if (typeof options === 'string') {
options = { url: options };
}
return new Promise(function(resolve, reject) {