Improve how aero is used

This commit is contained in:
Ryan Wilson
2024-09-24 11:39:37 -04:00
parent 24d80b34e0
commit bb725fcf54
6 changed files with 104 additions and 20 deletions
+48
View File
@@ -0,0 +1,48 @@
/** @import { Config } from "aero-proxy" */
const escapeKeyword = "_";
/**
* @type {Config}
*/
self.aeroConfig = {
bc: new BareMux(),
prefix: "/aero/service",
pathToInitialSW: "/sw.js",
bundles: {
"bare-mux": "/aero/BareMux.aero.js",
handle: "/aero/sw.aero.js",
sandbox: "/aero/sandbox/sandbox.aero.js"
},
aeroPathFilter: path =>
Object.values(self.config.bundles).find(bundlePath =>
path.startsWith(bundlePath)
) === null ||
path.startsWith("/tests/") ||
path.startsWith("/baremux") ||
path.startsWith("/epoxy/") ||
!path.startsWith(aeroConfig.prefix),
searchParamOptions: {
referrerPolicy: {
escapeKeyword,
searchParam: "passthroughReferrerPolicy"
},
isModule: {
escapeKeyword,
searchParam: "isModule"
},
integrity: {
escapeKeyword,
searchParam: "integrity"
}
},
cacheKey: "httpCache",
dynamicConfig: {
dbName: "aero",
id: "update"
},
//urlEncoder: __uv$config.urlEncoder,
//urlDecoder: __uv$config.urlDecoder,
urlEncoder: url => url,
urlDecoder: url => url
};