all repos — underbbs @ 1c1346e7cd9041c1c12c7ab702074cc38f4a4d82

decentralized social media client

add service worker - tsconfig is probably wrong
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQT/foVVmI9pK13hPWFohAcXSWbK8wUCZi6kdgAKCRBohAcXSWbK
80VoAQCClbDkKFNmXeSfX0gNyCuGI/GTqZK2VyvY51Rm8uqojgD9GNSFKEIt/s48
FaBaw1kOdtbpdydf194hMkSmA5tUqQ8=
=h5zo
-----END PGP SIGNATURE-----
commit

1c1346e7cd9041c1c12c7ab702074cc38f4a4d82

parent

d7600f28fcbe1e5d86e33c95195d75513e6e868d

5 files changed, 23 insertions(+), 3 deletions(-)

jump to
M .gitignore.gitignore

@@ -1,3 +1,3 @@

node_modules/ -dist/main.js +dist/*.js src/
M build.shbuild.sh

@@ -5,4 +5,4 @@ mkdir ./src

fi npx tsc && -npx webpack +npx webpack --config webpack.config.js
A ts/serviceWorker.ts

@@ -0,0 +1,9 @@

+/// <reference lib="WebWorker" /> + +// export empty type because of tsc --isolatedModules flag +export type {}; +declare const self: ServiceWorkerGlobalScope; + +self.addEventListener('sync', (e: any) => { + console.log(e); +});
M tsconfig.jsontsconfig.json

@@ -1,6 +1,8 @@

{ "compilerOptions": { - "target": "ES2022", + "target": "es5", + "lib": [ "es2022", "webworker", "dom" ], + "skipLibCheck": true, "module": "preserve", "moduleResolution": "bundler", "noImplicitAny": true,
A webpack.config.js

@@ -0,0 +1,9 @@

+const path = require('path'); + +module.exports = { + context: path.resolve(__dirname, 'src'), + entry: { + main: './index.js', + serviceWorker: './serviceWorker.js' + } +}