almostnode currently assumes the app is served from the origin root (/). Deploying to a sub-path (e.g. a GitHub Pages site at https://user.github.io/<repo>/<app>/) breaks in several places because the service worker path, scope, and virtual-server matching are all hardcoded to root. I got it working by patching the built SW + registration at build time, but it'd be great to support this first-class.
A "base-aware" mode would cover all of this:
- plugin emits
__sw__.js into the build, and
- SW + registration derive their base from
self.location / import.meta.env.BASE_URL instead of assuming /, with a configurable scope, and
- the referer-fallback scoped to in-app requests only.
almostnodecurrently assumes the app is served from the origin root (/). Deploying to a sub-path (e.g. a GitHub Pages site athttps://user.github.io/<repo>/<app>/) breaks in several places because the service worker path, scope, and virtual-server matching are all hardcoded to root. I got it working by patching the built SW + registration at build time, but it'd be great to support this first-class.A "base-aware" mode would cover all of this:
__sw__.jsinto the build, andself.location/import.meta.env.BASE_URLinstead of assuming/, with a configurablescope, and