manifest builder

This commit is contained in:
edde746 2023-11-30 14:38:12 +01:00
parent 07be9390bd
commit c4379c0b17
9 changed files with 1569 additions and 49 deletions

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

View file

@ -1,40 +0,0 @@
{
"short_name": "Stremio",
"name": "Stremio Web",
"description": "Freedom To Stream",
"icons": [
{
"src": "favicons/favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "images/icon_x192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "images/icon_x512.png",
"type": "image/png",
"sizes": "512x512"
},
{
"src": "images/maskable_icon_x192.png",
"type": "image/png",
"sizes": "192x192",
"purpose": "maskable"
},
{
"src": "images/maskable_icon_x512.png",
"type": "image/png",
"sizes": "512x512",
"purpose": "maskable"
}
],
"start_url": "https://web.stremio.com",
"scope": "https://web.stremio.com",
"display": "standalone",
"orientation": "any",
"theme_color": "#2a2843",
"background_color": "#161523"
}

1539
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -69,6 +69,7 @@
"webpack": "5.61.0",
"webpack-cli": "4.9.1",
"webpack-dev-server": "^4.7.4",
"webpack-pwa-manifest": "^4.3.0",
"workbox-webpack-plugin": "^6.5.3"
}
}

View file

@ -7,9 +7,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-title" content="Stremio">
<link rel="icon" type="image/png" sizes="96x96" href="<%= htmlWebpackPlugin.options.faviconsPath %>/icon-96.png">
<link rel="manifest" href="<%= htmlWebpackPlugin.options.manifestPath %>" />
<meta name="theme-color" content="<%= htmlWebpackPlugin.options.themeColor %>">
<link rel="apple-touch-icon" href="<%= htmlWebpackPlugin.options.imagesPath %>/icon_x192.png">
<title>Stremio - Freedom to Stream</title>
<%= htmlWebpackPlugin.tags.headTags %>
</head>

View file

@ -9,6 +9,7 @@ const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const WorkboxPlugin = require('workbox-webpack-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
const TerserPlugin = require('terser-webpack-plugin');
const WebpackPwaManifest = require('webpack-pwa-manifest');
const colors = require('@stremio/stremio-colors');
const pachageJson = require('./package.json');
@ -199,7 +200,6 @@ module.exports = (env, argv) => ({
patterns: [
{ from: 'favicons', to: `${COMMIT_HASH}/favicons` },
{ from: 'images', to: `${COMMIT_HASH}/images` },
{ from: 'manifest.json', to: `manifest.json` },
]
}),
new MiniCssExtractPlugin({
@ -212,7 +212,37 @@ module.exports = (env, argv) => ({
themeColor: colors.background,
faviconsPath: `${COMMIT_HASH}/favicons`,
imagesPath: `${COMMIT_HASH}/images`,
manifestPath: `manifest.json`,
})
}),
new WebpackPwaManifest({
name: 'Stremio Web',
short_name: 'Stremio',
description: 'Freedom To Stream',
background_color: '#161523',
theme_color: '#2a2843',
orientation: 'any',
display: 'standalone',
start_url: './',
scope: './',
publicPath: './',
icons: [
{
src: 'images/icon.png',
sizes: [196, 512],
ios: true
},
{
src: 'images/maskable_icon.png',
sizes: [196, 512],
purpose: 'maskable',
destination: path.join(COMMIT_HASH, 'images', 'maskable')
},
{
src: 'favicons/favicon.ico',
sizes: [64, 32, 24, 16]
}
].map(icon => ({ ...icon, destination: icon.destination ?? path.join(COMMIT_HASH, 'images') })),
fingerprints: false,
ios: true
}),
].filter(Boolean)
});