Loading package.json +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ "private": true, "type": "module", "scripts": { "build": "npm run build:ts && npm run build:single-html && npm run build:sw", "build": "npm run build:sw && npm run build:ts && npm run build:single-html", "build:ts": "tsc -p tsconfig.emit.json", "build:sw": "tsc -p tsconfig.sw.json", "build:bundle": "node ./scripts/bundle-main.mjs", Loading src/service-worker.ts +12 −12 Original line number Diff line number Diff line Loading @@ -4,18 +4,18 @@ const CACHE_NAME = "tinyvisualizer-cache"; const STATIC_ASSETS = [ "/index.html", "/public/manifest.json", "/dist/main.js", "/public/styles.css", "/public/logo192.png", "/public/favicon.ico", "/public/wasm/tinycc.js", "/public/wasm/tinycc.wasm", "/public/wasm/tinyvm.js", "/public/wasm/tinyvm.wasm", "/public/wasm/tinyas.js", "/public/wasm/tinyas.wasm" "./index.html", "./public/manifest.json", "./dist/main.js", "./public/styles.css", "./public/logo192.png", "./public/favicon.ico", "./public/wasm/tinycc.js", "./public/wasm/tinycc.wasm", "./public/wasm/tinyvm.js", "./public/wasm/tinyvm.wasm", "./public/wasm/tinyas.js", "./public/wasm/tinyas.wasm", ]; self.addEventListener("install", (event: ExtendableEvent) => { Loading src/serviceWorkerRegistration.ts +3 −4 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ type Config = { export function register(config?: Config) { if ('serviceWorker' in navigator) { window.addEventListener('load', () => { const swUrl = `/service-worker.js`; const swUrl = `./service-worker.js`; if (isLocalhost) { // This is running on localhost. Let's check if a service worker still exists or not. Loading @@ -24,8 +24,7 @@ export function register(config?: Config) { // service worker/PWA documentation. navigator.serviceWorker.ready.then(() => { console.log( 'This web app is being served cache-first by a service ' + 'worker.' 'This web app is being served cache-first by a service worker' ); }); } else { Loading @@ -39,7 +38,7 @@ export function register(config?: Config) { function registerValidSW(swUrl: string, config?: Config) { navigator.serviceWorker .register(swUrl, { 'type': 'module' type: 'module' }) .then((registration) => { registration.onupdatefound = () => { Loading tsconfig.json +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ "sourceMap": true, "skipLibCheck": true }, "exclude": [ "src/service-worker.ts" ], "include": [ "src/**/*.ts", "src/**/*.tsx", Loading tsconfig.sw.json +5 −5 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ "compilerOptions": { "composite": true, "esModuleInterop": true, "module": "es2020", "moduleResolution": "node", "outDir": "dist", "rootDir": "src", "module": "node20", "moduleResolution": "node16", "outDir": "dist/", "rootDir": "src/", "lib": ["WebWorker", "ESNext"], "skipLibCheck": true }, "include": [ "files": [ "src/service-worker.ts" ] } No newline at end of file src/main.tsx +1 −1 File changed.Contains only whitespace changes. Show changes Loading
package.json +1 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ "private": true, "type": "module", "scripts": { "build": "npm run build:ts && npm run build:single-html && npm run build:sw", "build": "npm run build:sw && npm run build:ts && npm run build:single-html", "build:ts": "tsc -p tsconfig.emit.json", "build:sw": "tsc -p tsconfig.sw.json", "build:bundle": "node ./scripts/bundle-main.mjs", Loading
src/service-worker.ts +12 −12 Original line number Diff line number Diff line Loading @@ -4,18 +4,18 @@ const CACHE_NAME = "tinyvisualizer-cache"; const STATIC_ASSETS = [ "/index.html", "/public/manifest.json", "/dist/main.js", "/public/styles.css", "/public/logo192.png", "/public/favicon.ico", "/public/wasm/tinycc.js", "/public/wasm/tinycc.wasm", "/public/wasm/tinyvm.js", "/public/wasm/tinyvm.wasm", "/public/wasm/tinyas.js", "/public/wasm/tinyas.wasm" "./index.html", "./public/manifest.json", "./dist/main.js", "./public/styles.css", "./public/logo192.png", "./public/favicon.ico", "./public/wasm/tinycc.js", "./public/wasm/tinycc.wasm", "./public/wasm/tinyvm.js", "./public/wasm/tinyvm.wasm", "./public/wasm/tinyas.js", "./public/wasm/tinyas.wasm", ]; self.addEventListener("install", (event: ExtendableEvent) => { Loading
src/serviceWorkerRegistration.ts +3 −4 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ type Config = { export function register(config?: Config) { if ('serviceWorker' in navigator) { window.addEventListener('load', () => { const swUrl = `/service-worker.js`; const swUrl = `./service-worker.js`; if (isLocalhost) { // This is running on localhost. Let's check if a service worker still exists or not. Loading @@ -24,8 +24,7 @@ export function register(config?: Config) { // service worker/PWA documentation. navigator.serviceWorker.ready.then(() => { console.log( 'This web app is being served cache-first by a service ' + 'worker.' 'This web app is being served cache-first by a service worker' ); }); } else { Loading @@ -39,7 +38,7 @@ export function register(config?: Config) { function registerValidSW(swUrl: string, config?: Config) { navigator.serviceWorker .register(swUrl, { 'type': 'module' type: 'module' }) .then((registration) => { registration.onupdatefound = () => { Loading
tsconfig.json +3 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,9 @@ "sourceMap": true, "skipLibCheck": true }, "exclude": [ "src/service-worker.ts" ], "include": [ "src/**/*.ts", "src/**/*.tsx", Loading
tsconfig.sw.json +5 −5 Original line number Diff line number Diff line Loading @@ -2,14 +2,14 @@ "compilerOptions": { "composite": true, "esModuleInterop": true, "module": "es2020", "moduleResolution": "node", "outDir": "dist", "rootDir": "src", "module": "node20", "moduleResolution": "node16", "outDir": "dist/", "rootDir": "src/", "lib": ["WebWorker", "ESNext"], "skipLibCheck": true }, "include": [ "files": [ "src/service-worker.ts" ] } No newline at end of file