Commit abdf0e1c authored by Jérome Perrin's avatar Jérome Perrin Committed by Thomas Gambier

generate a service worker

npm install workbox-cli
./node_modules/.bin/workbox injectManifest workbox-config.js

service worker: ignore query string for fonts

The compilation was run with 'ASSET_PATH="dist/" make'. This is needed
for officejs app because the HTML is not at the root of the domain
(https://converse.app.officejs.com/563950fb93/fullscreen.html).
parent 241bd231
......@@ -46,6 +46,10 @@
For more information, please refer to <http://unlicense.org/>
@licend
*/
window.addEventListener('load', () => {
navigator.serviceWorker.register('sw.js');
});
converse.initialize({
assets_path: 'dist/',
authentication: 'login',
......
This diff is collapsed.
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.4/workbox-sw.js');
workbox.core.setCacheNameDetails({
prefix: 'converse.nexedi',
});
// Note: this is populated at build time.
workbox.precaching.precacheAndRoute(self.__WB_MANIFEST,
// we ignore wvi0ht for urls like :
// /fonticons/fonts/icomoon.ttf?wvi0ht
{ ignoreUrlParametersMatching: [/^wvi0ht/] }
)
module.exports = {
globDirectory: '.',
globPatterns: [
'*.html',
'manifest.json',
'dist/**',
'css/**',
'locale/**',
'sounds/**',
'logo/**',
],
swSrc: 'sw.template.js',
swDest: 'sw.js',
maximumFileSizeToCacheInBytes: 1024**4
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment