Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async function start() {
if (server) return server;
server = express();
server.use(createLaunchEditorMiddleware());
server.use(express.static(path.resolve(__dirname, '../public')));
// Configure client-side hot module replacement
const clientConfig = webpackConfig.find(config => config.name === 'client');
clientConfig.entry.client = [
'react-error-overlay',
'react-hot-loader/patch',
'webpack-hot-middleware/client?name=client&reload=true',
]
.concat(clientConfig.entry.client)
.sort((a, b) => b.includes('polyfill') - a.includes('polyfill'));
clientConfig.output.filename = clientConfig.output.filename.replace(
'chunkhash',
'hash',
);
clientConfig.output.chunkFilename = clientConfig.output.chunkFilename.replace(
setup(app) {
// This lets us open files from the runtime error overlay.
app.use(errorOverlayMiddleware());
},
watchOptions: {
setup: app => {
app.use(errorOverlayMiddleware())
if (options.server) {
app.use(options.server)
}
},
watchOptions: {