mirror of
https://github.com/ergosteur/instaarchive-viewer.git
synced 2026-07-04 11:07:15 -04:00
Sets up a new React PWA project with Vite, Tailwind CSS, and basic PWA features. Includes essential files like README, .gitignore, package.json, and initial app structure.
72 lines
2.1 KiB
TypeScript
72 lines
2.1 KiB
TypeScript
import tailwindcss from '@tailwindcss/vite';
|
||
import react from '@vitejs/plugin-react';
|
||
import path from 'path';
|
||
import {defineConfig, loadEnv} from 'vite';
|
||
import { VitePWA } from 'vite-plugin-pwa';
|
||
|
||
export default defineConfig(({mode}) => {
|
||
const env = loadEnv(mode, '.', '');
|
||
return {
|
||
plugins: [
|
||
react(),
|
||
tailwindcss(),
|
||
VitePWA({
|
||
registerType: 'prompt',
|
||
manifest: {
|
||
name: 'InstaArchive',
|
||
short_name: 'InstaArchive',
|
||
description: 'Browse your archived Instagram data with a native-feeling interface.',
|
||
theme_color: '#ffffff',
|
||
background_color: '#ffffff',
|
||
display: 'standalone',
|
||
icons: [
|
||
{
|
||
src: 'https://cdn-icons-png.flaticon.com/512/174/174855.png',
|
||
sizes: '512x512',
|
||
type: 'image/png',
|
||
purpose: 'any maskable'
|
||
},
|
||
{
|
||
src: 'https://cdn-icons-png.flaticon.com/192/174/174855.png',
|
||
sizes: '192x192',
|
||
type: 'image/png'
|
||
}
|
||
]
|
||
},
|
||
workbox: {
|
||
globPatterns: ['**/*.{js,css,html,ico,png,svg,woff,woff2}'],
|
||
runtimeCaching: [
|
||
{
|
||
urlPattern: /^https:\/\/fonts\.googleapis\.com\/.*/i,
|
||
handler: 'CacheFirst',
|
||
options: {
|
||
cacheName: 'google-fonts-cache',
|
||
expiration: {
|
||
maxEntries: 10,
|
||
maxAgeSeconds: 60 * 60 * 24 * 365
|
||
},
|
||
cacheableResponse: {
|
||
statuses: [0, 200]
|
||
}
|
||
}
|
||
}
|
||
]
|
||
}
|
||
})
|
||
],
|
||
define: {
|
||
'process.env.GEMINI_API_KEY': JSON.stringify(env.GEMINI_API_KEY),
|
||
},
|
||
resolve: {
|
||
alias: {
|
||
'@': path.resolve(__dirname, '.'),
|
||
},
|
||
},
|
||
server: {
|
||
// HMR is disabled in AI Studio via DISABLE_HMR env var.
|
||
// Do not modifyâfile watching is disabled to prevent flickering during agent edits.
|
||
hmr: process.env.DISABLE_HMR !== 'true',
|
||
},
|
||
};
|
||
});
|