Skip to content

Commit

Permalink
pwa-config
Browse files Browse the repository at this point in the history
  • Loading branch information
jsahagun91 committed Aug 2, 2024
1 parent fef85eb commit 9f45d42
Show file tree
Hide file tree
Showing 6 changed files with 2,437 additions and 17 deletions.
3 changes: 3 additions & 0 deletions frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<html lang="en" class="min-h-screen">
<head>
<meta charset="utf-8" />
<link rel="icon" href="/public/favicon.svg" />
<link rel="manifest" href="/public/manifest.json" />
<meta name="theme-color" content="#000000" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Alby Hub</title>
<link rel="icon" href="/favicon.svg" />
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"tailwind-merge": "^2.2.2",
"tailwindcss-animate": "^1.0.7",
"vaul": "^0.9.1",
"vite-plugin-pwa": "^0.20.1",
"zustand": "^4.5.0"
},
"devDependencies": {
Expand Down
16 changes: 16 additions & 0 deletions frontend/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"short_name": "Alby Hub",
"name": "Alby Hub",
"icons": [
{
"src": "favicon.svg",
"sizes": "any",
"type": "image/svg+xml"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}

2 changes: 1 addition & 1 deletion frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"target": "ES2020",
"useDefineForClassFields": true,
"lib": ["ES2020", "DOM", "DOM.Iterable"],
"lib": ["ES2020", "DOM", "DOM.Iterable", "WebWorker"],
"module": "ESNext",
"skipLibCheck": true,

Expand Down
45 changes: 35 additions & 10 deletions frontend/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,48 @@
import react from "@vitejs/plugin-react-swc";
import path from "path";
import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react-swc';
import path from 'path';
import tsconfigPaths from 'vite-tsconfig-paths';
import { VitePWA } from 'vite-plugin-pwa';

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react(), tsconfigPaths()],
plugins: [
react(),
tsconfigPaths(),
VitePWA({
registerType: 'autoUpdate',
includeAssets: ['favicon.ico', 'robots.txt', 'apple-touch-icon.png'],
manifest: {
short_name: 'Alby Hub',
name: 'Alby Hub',
icons: [
{
src: 'favicon.svg',
sizes: 'any',
type: 'image/svg+xml'
}
],
start_url: '.',
display: 'standalone',
theme_color: '#000000',
background_color: '#ffffff'
},
workbox: {
globPatterns: ['**/*.{js,css,html,png,svg,ico}']
}
})
],
server: {
proxy: {
"/api": {
target: "http://localhost:8080",
'/api': {
target: 'http://localhost:8080',
secure: false,
},
},
},
resolve: {
alias: {
src: path.resolve(__dirname, "./src"),
wailsjs: path.resolve(__dirname, "./wailsjs"),
src: path.resolve(__dirname, './src'),
wailsjs: path.resolve(__dirname, './wailsjs'),
},
},
});
Loading

0 comments on commit 9f45d42

Please sign in to comment.