diff --git a/src/browser/register.ts b/src/browser/register.ts index 0c3d7790..4774ad5f 100644 --- a/src/browser/register.ts +++ b/src/browser/register.ts @@ -5,7 +5,7 @@ export async function registerServiceWorker(): Promise { const options = getOptions() logger.level = options.logLevel - const path = normalize(`${options.csStaticBase}/dist/serviceWorker.js`) + const path = normalize(`${options.csStaticBase}/out/browser/serviceWorker.js`) try { await navigator.serviceWorker.register(path, { scope: options.base + "/", diff --git a/test/unit/browser/register.test.ts b/test/unit/browser/register.test.ts index 6d1443f1..f2302cb8 100644 --- a/test/unit/browser/register.test.ts +++ b/test/unit/browser/register.test.ts @@ -155,7 +155,7 @@ describe("register", () => { await registerServiceWorker() expect(mockFn).toBeCalled() - expect(serviceWorkerPath).toMatch(`${csStaticBasePath}/dist/serviceWorker.js`) + expect(serviceWorkerPath).toMatch(`${csStaticBasePath}/out/browser/serviceWorker.js`) expect(serviceWorkerScope).toMatch("/") }) it("should register when options.base is defined", async () => { @@ -176,7 +176,7 @@ describe("register", () => { await registerServiceWorker() expect(mockFn).toBeCalled() - expect(serviceWorkerPath).toMatch(`/dist/serviceWorker.js`) + expect(serviceWorkerPath).toMatch(`/out/browser/serviceWorker.js`) expect(serviceWorkerScope).toMatch("/") }) })