Fixed PWA image path on development build

pull/2572/head v1.4.4-beta.19
Anderson Shindy Oki 5 months ago
parent 0f14a33c73
commit 5886c20c9c

@ -23,6 +23,8 @@ export default defineConfig(async ({ mode, command }) => {
const ws = env.VITE_ALLOW_WEBSOCKET === "true";
const secure = env.VITE_PROXY_SECURE === "true";
const imagesFolder = mode === "development" ? "public/images" : "images";
return {
plugins: [
react(),
@ -36,8 +38,8 @@ export default defineConfig(async ({ mode, command }) => {
VitePWA({
registerType: "autoUpdate",
includeAssets: [
"/images/favicon.ico",
"/images/apple-touch-icon-180x180.png",
`${imagesFolder}/favicon.ico`,
`${imagesFolder}/apple-touch-icon-180x180.png`,
],
manifest: {
name: "Bazarr",
@ -47,45 +49,45 @@ export default defineConfig(async ({ mode, command }) => {
theme_color: "#be4bdb",
icons: [
{
src: "/images/pwa-64x64.png",
src: `${imagesFolder}/pwa-64x64.png`,
sizes: "64x64",
type: "image/png",
},
{
src: "/images/pwa-192x192.png",
src: `${imagesFolder}/pwa-192x192.png`,
sizes: "192x192",
type: "image/png",
},
{
src: "/images/pwa-512x512.png",
src: `${imagesFolder}/pwa-512x512.png`,
sizes: "512x512",
type: "image/png",
},
],
screenshots: [
{
src: "/images/pwa-wide-series-list.jpeg",
src: `/${imagesFolder}/pwa-wide-series-list.jpeg`,
sizes: "1447x1060",
label: "Series List",
form_factor: "wide",
type: "image/jpeg",
},
{
src: "/images/pwa-wide-series-overview.jpeg",
src: `/${imagesFolder}/pwa-wide-series-overview.jpeg`,
sizes: "1447x1060",
label: "Series Overview",
form_factor: "wide",
type: "image/jpeg",
},
{
src: "/images/pwa-narrow-series-list.jpeg",
src: `/${imagesFolder}/pwa-narrow-series-list.jpeg`,
sizes: "491x973",
label: "Series List",
form_factor: "narrow",
type: "image/jpeg",
},
{
src: "/images/pwa-narrow-series-overview.jpeg",
src: `/${imagesFolder}/pwa-narrow-series-overview.jpeg`,
sizes: "491x973",
label: "Series Overview",
form_factor: "narrow",

Loading…
Cancel
Save