move pwa to web static, change desc
|
@ -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', () => {});
|
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 60 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
@ -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",
|
14
web/static/pwa/serviceWorker.js
Normal 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', () => {});
|
|
@ -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}/`,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|