sticky-notes/pwa-assets.config.ts

37 lines
906 B
TypeScript
Raw Normal View History

2023-10-06 11:21:25 +08:00
import {
AllAppleDeviceNames,
createAppleSplashScreens,
defineConfig,
} from '@vite-pwa/assets-generator/config';
export default defineConfig({
images: ['static/favicon.svg'],
preset: {
transparent: { sizes: [] },
maskable: { sizes: [] },
apple: { sizes: [] },
appleSplashScreens: createAppleSplashScreens(
{
name: (landscape, size, dark) => {
2023-10-08 01:33:47 +08:00
return `splash/apple-splash-${landscape ? 'landscape' : 'portrait'}-${
2023-10-06 11:21:25 +08:00
typeof dark === 'boolean' ? (dark ? 'dark-' : 'light-') : ''
}${size.width}x${size.height}.png`;
},
padding: 0.8,
resizeOptions: { background: '#fbfbfc', fit: 'contain' },
darkResizeOptions: { background: '#18232c', fit: 'contain' },
linkMediaOptions: {
basePath: '/',
log: true,
addMediaScreen: false,
},
png: {
compressionLevel: 9,
quality: 60,
},
},
[...AllAppleDeviceNames]
),
},
});