Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(webpack): rewrite CDN urls when proxying with webpack (#15938)

Aaron van Meerten6b5245be4453
diff --git a/webpack.config.js b/webpack.config.js
index 02bf79b4e4..740877a293 100644
--- a/webpack.config.js
+++ b/webpack.config.js
@@ -63,24 +63,31 @@ function getBundleAnalyzerPlugin(analyzeBundle, name) {
* target, undefined; otherwise, the path to the local file to be served.
*/
function devServerProxyBypass({ path }) {
- if (path.startsWith('/css/')
- || path.startsWith('/doc/')
- || path.startsWith('/fonts/')
- || path.startsWith('/images/')
- || path.startsWith('/lang/')
- || path.startsWith('/sounds/')
- || path.startsWith('/static/')
- || path.endsWith('.wasm')) {
-
- return path;
+ let tpath = path;
+
+ if (tpath.startsWith('/v1/_cdn/')) {
+ // The CDN is not available in the dev server, so we need to bypass it.
+ tpath = tpath.replace(/\/v1\/_cdn\/[^/]+\//, '/');
+ }
+
+ if (tpath.startsWith('/css/')
+ || tpath.startsWith('/doc/')
+ || tpath.startsWith('/fonts/')
+ || tpath.startsWith('/images/')
+ || tpath.startsWith('/lang/')
+ || tpath.startsWith('/sounds/')
+ || tpath.startsWith('/static/')
+ || tpath.endsWith('.wasm')) {
+
+ return tpath;
}
- if (path.startsWith('/libs/')) {
- if (path.endsWith('.min.js') && !fs.existsSync(join(process.cwd(), path))) {
- return path.replace('.min.js', '.js');
+ if (tpath.startsWith('/libs/')) {
+ if (tpath.endsWith('.min.js') && !fs.existsSync(join(process.cwd(), tpath))) {
+ return tpath.replace('.min.js', '.js');
}
- return path;
+ return tpath;
}
}