move pwa to web static, change desc

This commit is contained in:
zeppi 2021-06-04 14:58:32 -04:00 committed by jessopb
parent 7eeb3d3c55
commit a0c2f8fa40
8 changed files with 19 additions and 17 deletions

View file

@ -1,11 +0,0 @@
// register service worker
if ('serviceWorker' in navigator) {
navigator.serviceWorker.register('./serviceWorker.js').then(function(reg) {
// reg.scope must be '/' to allow '/' as start url
}).catch(function(err) {
// console.warn('Error whilst registering service worker', err);
});
}
// used to fetch the manifest file
self.addEventListener('fetch', () => {});

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

View file

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View file

@ -4,7 +4,7 @@
"theme_color": "#fa6164", "theme_color": "#fa6164",
"background_color": "#FAFAFA", "background_color": "#FAFAFA",
"display": "minimal-ui", "display": "minimal-ui",
"description": "Odysee is a place where you can find great videos, music, ebooks, and more: imagine a vast digital library that is available on all of your devices.", "description": "Launch your own channel | Watch and share videos",
"scope": "/", "scope": "/",
"start_url": "/", "start_url": "/",
"icons": [ "icons": [
@ -17,8 +17,7 @@
"src": "/public/pwa/icon-512.png", "src": "/public/pwa/icon-512.png",
"type": "image/png", "type": "image/png",
"sizes": "512x512" "sizes": "512x512"
} },
,
{ {
"src": "/public/pwa/icon-180.png", "src": "/public/pwa/icon-180.png",
"type": "image/png", "type": "image/png",

View file

@ -0,0 +1,14 @@
// register service worker
if ('serviceWorker' in navigator) {
navigator.serviceWorker
.register('./serviceWorker.js')
.then(function (reg) {
// reg.scope must be '/' to allow '/' as start url
})
.catch(function (err) {
// console.warn('Error whilst registering service worker', err);
});
}
// used to fetch the manifest file
self.addEventListener('fetch', () => {});

View file

@ -15,6 +15,7 @@ const CUSTOM_ROOT = path.resolve(__dirname, '../custom/');
const STATIC_ROOT = path.resolve(__dirname, '../static/'); const STATIC_ROOT = path.resolve(__dirname, '../static/');
const UI_ROOT = path.resolve(__dirname, '../ui/'); const UI_ROOT = path.resolve(__dirname, '../ui/');
const DIST_ROOT = path.resolve(__dirname, 'dist/'); const DIST_ROOT = path.resolve(__dirname, 'dist/');
const WEB_STATIC_ROOT = path.resolve(__dirname, 'static/');
const WEB_PLATFORM_ROOT = __dirname; const WEB_PLATFORM_ROOT = __dirname;
const isProduction = process.env.NODE_ENV === 'production'; const isProduction = process.env.NODE_ENV === 'production';
const hasSentryToken = process.env.SENTRY_AUTH_TOKEN !== undefined; const hasSentryToken = process.env.SENTRY_AUTH_TOKEN !== undefined;
@ -58,12 +59,11 @@ const copyWebpackCommands = [
to: `${DIST_ROOT}/public/font/`, to: `${DIST_ROOT}/public/font/`,
}, },
{ {
from: `${STATIC_ROOT}/pwa/`, from: `${WEB_STATIC_ROOT}/pwa/`,
to: `${DIST_ROOT}/public/pwa/`, to: `${DIST_ROOT}/public/pwa/`,
}, },
// move serviceWorker to directory root
{ {
from: `${STATIC_ROOT}/pwa/serviceWorker.js`, from: `${WEB_STATIC_ROOT}/pwa/serviceWorker.js`,
to: `${DIST_ROOT}/`, to: `${DIST_ROOT}/`,
}, },
]; ];