build: service-worker to TS
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/888/head
parent
bcd1764779
commit
77d91f81e8
|
@ -1,6 +1,8 @@
|
|||
import { CacheExpiration } from 'workbox-expiration';
|
||||
import { workerExport } from '../../worker';
|
||||
|
||||
declare var self: ServiceWorkerGlobalScope;
|
||||
|
||||
interface BlobCallback {
|
||||
resolve: (blob: Blob) => void;
|
||||
reject: (err: Error) => void;
|
||||
|
|
|
@ -3,6 +3,8 @@ import { NetworkFirst, CacheFirst } from 'workbox-strategies';
|
|||
import { registerRoute } from 'workbox-routing';
|
||||
import { ExpirationPlugin } from 'workbox-expiration';
|
||||
|
||||
declare var self: ServiceWorkerGlobalScope;
|
||||
|
||||
precacheAndRoute(self.__WB_MANIFEST);
|
||||
cleanupOutdatedCaches();
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
"compilerOptions": {
|
||||
"lib": [
|
||||
"dom",
|
||||
"WebWorker",
|
||||
"es2017"
|
||||
],
|
||||
"target": "ES2017",
|
||||
|
|
|
@ -109,7 +109,7 @@ module.exports = {
|
|||
|
||||
// Bundle service worker
|
||||
new WorkboxPlugin.InjectManifest({
|
||||
swSrc: path.resolve(path.join('src', 'service-worker.js')),
|
||||
swSrc: path.resolve(path.join('src', 'service-worker.ts')),
|
||||
swDest: 'memories-service-worker.js',
|
||||
maximumFileSizeToCacheInBytes: (isDev ? 10 : 4) * 1024 * 1024,
|
||||
}),
|
||||
|
|
Loading…
Reference in New Issue