mirror of
https://github.com/FranP-code/create-better-t-stack.git
synced 2025-10-12 23:52:15 +00:00
Add Progressive Web App (PWA) support
Add PWA setup with vite-plugin-pwa, assets generator, and templates Include CLI flag and interactive prompt option for PWA installation
This commit is contained in:
@@ -19,3 +19,5 @@ dist/
|
||||
|
||||
*.env*
|
||||
!.env.example
|
||||
|
||||
dev-dist
|
||||
|
||||
BIN
apps/cli/template/with-pwa/packages/client/public/logo.png
Normal file
BIN
apps/cli/template/with-pwa/packages/client/public/logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,12 @@
|
||||
import {
|
||||
defineConfig,
|
||||
minimal2023Preset as preset,
|
||||
} from "@vite-pwa/assets-generator/config";
|
||||
|
||||
export default defineConfig({
|
||||
headLinkOptions: {
|
||||
preset: "2023",
|
||||
},
|
||||
preset,
|
||||
images: ["public/logo.png"],
|
||||
});
|
||||
35
apps/cli/template/with-pwa/packages/client/vite.config.ts
Normal file
35
apps/cli/template/with-pwa/packages/client/vite.config.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
import tailwindcss from "@tailwindcss/vite";
|
||||
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
|
||||
import react from "@vitejs/plugin-react";
|
||||
import path from "path";
|
||||
import { defineConfig } from "vite";
|
||||
import { VitePWA } from "vite-plugin-pwa";
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
tailwindcss(),
|
||||
TanStackRouterVite({}),
|
||||
react(),
|
||||
VitePWA({
|
||||
registerType: "autoUpdate",
|
||||
manifest: {
|
||||
name: "My App",
|
||||
short_name: "My App ",
|
||||
description: "My App",
|
||||
theme_color: "#0c0c0c",
|
||||
},
|
||||
pwaAssets: {
|
||||
disabled: false,
|
||||
config: true,
|
||||
},
|
||||
devOptions: {
|
||||
enabled: true,
|
||||
},
|
||||
}),
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": path.resolve(__dirname, "./src"),
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user