Skip to content
Snippets Groups Projects
Commit f9dec427 authored by Moritz Langenstein's avatar Moritz Langenstein
Browse files

(ml5717) Automatically generate service-worker cache list

parent 35c77987
No related branches found
No related tags found
1 merge request!71Rust WASM CRDT implementation
Pipeline #109185 passed
......@@ -74,6 +74,7 @@ build:
- npm_install
script:
- npm run build
- gcc -E -P -traditional-cpp -o /dev/stdout -DFILES_TO_CACHE_LIST=`find public/ -type f "!" -iname service-worker.js -and "!" -name '.*' | cut -c6- | sed 's_._"_' | sed 's/$/",/' | sort | tr -d '\n'` - < public/service-worker.js | npx prettier --parser babel > public/service-worker.js
artifacts:
paths:
- public/
......
......@@ -7,25 +7,7 @@ self.addEventListener("activate", (event) => {
})
const CACHE_NAME = "APP-V0"
const FILES_TO_CACHE = [
"/index.html",
"/styles.css",
"/cursor.svg",
"/js/app.js",
"/js/queue.js",
"/logo.png",
"/manifest.json",
"/assets/fonts/martel-v4-latin/martel-v4-latin-regular.eot",
"/assets/fonts/martel-v4-latin/martel-v4-latin-regular.svg",
"/assets/fonts/martel-v4-latin/martel-v4-latin-regular.ttf",
"/assets/fonts/martel-v4-latin/martel-v4-latin-regular.woff",
"/assets/fonts/martel-v4-latin/martel-v4-latin-regular.woff2",
"/synchronising.svg",
"/synchronised.svg",
"/quality-high.svg",
"/quality-medium.svg",
"/quality-low.svg",
]
const FILES_TO_CACHE = [FILES_TO_CACHE_LIST] // eslint-disable-line no-undef
const FILE_ALIASES = new Map([["/", "/index.html"]])
self.addEventListener("install", async () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment