composer and npm

This commit is contained in:
Henry Whitaker
2020-08-25 00:59:44 +01:00
parent 6726d93cc6
commit c8f853dc84
2504 changed files with 88530 additions and 41367 deletions

View File

@@ -118,7 +118,7 @@ class Server {
this.setupDevMiddleware();
// set express routes
routes(this.app, this.middleware, this.options);
routes(this);
// Keep track of websocket proxies for external websocket upgrade.
this.websocketProxies = [];
@@ -155,6 +155,10 @@ class Server {
}
this.sockWrite(this.sockets, 'progress-update', { percent, msg });
if (this.listeningApp) {
this.listeningApp.emit('progress-update', { percent, msg });
}
}).apply(this.compiler);
}
@@ -342,8 +346,17 @@ class Server {
const contentBasePublicPath = this.options.contentBasePublicPath;
if (Array.isArray(contentBase)) {
contentBase.forEach((item) => {
this.app.use(contentBasePublicPath, express.static(item));
contentBase.forEach((item, index) => {
let publicPath = contentBasePublicPath;
if (
Array.isArray(contentBasePublicPath) &&
contentBasePublicPath[index]
) {
publicPath = contentBasePublicPath[index] || contentBasePublicPath[0];
}
this.app.use(publicPath, express.static(item));
});
} else if (isAbsoluteUrl(String(contentBase))) {
this.log.warn(
@@ -401,7 +414,7 @@ class Server {
return next();
}
serveIndex(item)(req, res, next);
serveIndex(item, { icons: true })(req, res, next);
});
});
} else if (
@@ -414,7 +427,7 @@ class Server {
return next();
}
serveIndex(contentBase)(req, res, next);
serveIndex(contentBase, { icons: true })(req, res, next);
});
}
}
@@ -674,6 +687,10 @@ class Server {
} else {
this.listeningApp = http.createServer(this.app);
}
this.listeningApp.on('error', (err) => {
this.log.error(err);
});
}
createSocketServer() {