File tree 9 files changed +96
-3
lines changed
9 files changed +96
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"$schema" : " https://unpkg.com/knip@5/schema.json" ,
3
- "ignore" : [" src/route-tree.gen.ts" ],
3
+ "ignore" : [" src/route-tree.gen.ts" , " pwa-assets.config.ts " ],
4
4
"ignoreDependencies" : [" gitzy" , " @iconify-json/*" ],
5
5
"eslint" : {
6
6
"entry" : [" eslint.config.ts" ]
Original file line number Diff line number Diff line change 6
6
7
7
- 🍞 [ bun] [ bun ] for a fast runtime and package manager.
8
8
- ⚡️ [ vite] [ vite ] for instant server start and lighting fast HMR.
9
+ - ✨ [ Vite PWA] ( https://vite-pwa-org.netlify.app ) for PWAs with very little configuration.
9
10
- 🏷️ [ TypeScript] [ TypeScript ] for a less frustrating & consistent experience.
10
11
- 🏝️ [ TanStack Router] [ TanStack Router ] for a fully type-safe React router.
11
12
- 🏝️ [ TanStack Query] [ TanStack Query ] for asynchronous state management.
Original file line number Diff line number Diff line change 2
2
< html lang ="en ">
3
3
< head >
4
4
< meta charset ="UTF-8 " />
5
- < link rel ="icon " type ="image/svg+xml " href ="/favicon.ico " />
6
5
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7
6
< meta
8
7
name ="description "
Original file line number Diff line number Diff line change 58
58
"@types/bun" : " 1.1.13" ,
59
59
"@types/react" : " 18.3.12" ,
60
60
"@types/react-dom" : " 18.3.1" ,
61
+ "@vite-pwa/assets-generator" : " 0.2.6" ,
61
62
"@vitejs/plugin-react-swc" : " 3.7.1" ,
62
63
"@vitest/coverage-v8" : " 2.1.4" ,
63
64
"@vitest/ui" : " 2.1.4" ,
79
80
"turbo" : " 2.2.3" ,
80
81
"typescript" : " 5.6.3" ,
81
82
"vite" : " 5.4.10" ,
83
+ "vite-plugin-pwa" : " 0.20.5" ,
82
84
"vite-tsconfig-paths" : " 5.1.0" ,
83
85
"vitest" : " 2.1.4"
84
86
},
Original file line number Diff line number Diff line change
1
+ import {
2
+ defineConfig ,
3
+ minimal2023Preset as preset ,
4
+ } from "@vite-pwa/assets-generator/config" ;
5
+
6
+ export default defineConfig ( {
7
+ headLinkOptions : {
8
+ preset : "2023" ,
9
+ } ,
10
+ images : [ "public/logo.svg" ] ,
11
+ preset,
12
+ } ) ;
Original file line number Diff line number Diff line change 1
1
import { ExtLink } from "@/components/ext-link" ;
2
2
3
+ // eslint-disable-next-line import-x/no-absolute-path -- https://vite.dev/guide/assets#the-public-directory
4
+ import logo from "/logo.svg" ;
5
+
3
6
export const Home = ( ) => {
4
7
return (
5
8
< div className = "grid min-h-screen place-content-center" >
@@ -17,7 +20,8 @@ export const Home = () => {
17
20
React Starter
18
21
</ h1 >
19
22
< p className = "prose dsy-prose py-6" >
20
- 🍱 Another < ExtLink to = "React" > React</ ExtLink > Starter using{ " " }
23
+ < img alt = "logo" className = "not-prose inline max-h-6" src = { logo } /> { " " }
24
+ Another < ExtLink to = "React" > React</ ExtLink > Starter using{ " " }
21
25
< ExtLink to = "Bun" > Bun</ ExtLink > , < ExtLink to = "Vite" > Vite</ ExtLink >
22
26
, < ExtLink to = "TypeScript" > TypeScript</ ExtLink > ,{ " " }
23
27
< ExtLink to = "tailwindcss" > tailwindcss</ ExtLink > and{ " " }
Original file line number Diff line number Diff line change 1
1
import { TanStackRouterVite as tanStackRouterVite } from "@tanstack/router-vite-plugin" ;
2
2
import react from "@vitejs/plugin-react-swc" ;
3
3
import { defineConfig , loadEnv } from "vite" ;
4
+ import { VitePWA } from "vite-plugin-pwa" ;
4
5
import tsconfigPaths from "vite-tsconfig-paths" ;
5
6
import { configDefaults } from "vitest/config" ;
6
7
@@ -18,6 +19,46 @@ export default defineConfig(({ mode }) => {
18
19
semicolons : true ,
19
20
} ) ,
20
21
tsconfigPaths ( ) ,
22
+ VitePWA ( {
23
+ devOptions : {
24
+ type : "module" ,
25
+ } ,
26
+ manifest : {
27
+ icons : [
28
+ {
29
+ sizes : "64x64" ,
30
+ src : "pwa-64x64.png" ,
31
+ type : "image/png" ,
32
+ } ,
33
+ {
34
+ sizes : "192x192" ,
35
+ src : "pwa-192x192.png" ,
36
+ type : "image/png" ,
37
+ } ,
38
+ {
39
+ purpose : "any" ,
40
+ sizes : "512x512" ,
41
+ src : "pwa-512x512.png" ,
42
+ type : "image/png" ,
43
+ } ,
44
+ {
45
+ purpose : "maskable" ,
46
+ sizes : "512x512" ,
47
+ src : "maskable-icon-512x512.png" ,
48
+ type : "image/png" ,
49
+ } ,
50
+ ] ,
51
+ name : "React Starter" ,
52
+ short_name : "React Starter" ,
53
+ theme_color : "#ffffff" ,
54
+ } ,
55
+ pwaAssets : {
56
+ config : true ,
57
+ disabled : false ,
58
+ overrideManifestIcons : true ,
59
+ } ,
60
+ registerType : "autoUpdate" ,
61
+ } ) ,
21
62
] ,
22
63
server : {
23
64
port : Number ( PORT ) ,
You can’t perform that action at this time.
0 commit comments