Skip to content

Commit 7237984

Browse files
authored
Merge pull request #112 from jeremykenedy/dev
Dev
2 parents 8c94f99 + 233911d commit 7237984

File tree

7 files changed

+3029
-370
lines changed

7 files changed

+3029
-370
lines changed

.env.example

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ VITE_SERVER_HTTPS_CERT='/Users/ENTERYOURSYSTEMPATH/.config/valet/Certificates/la
9090
VITE_SERVER_HOST='YOUR-PROJECT-URL.test'
9191
VITE_SENTRY_IO_ENABLED="${SENTRY_IO_ENABLED}"
9292
VITE_APP_ENV="${APP_ENV}"
93+
VITE_APP_NAME="${APP_NAME}"
9394

9495
VITE_SERVER_ENABLED=true
9596
VITE_SERVER_SECURE=false

package-lock.json

+2,957-369
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"babel-loader": "^9.1.0",
5656
"chart.js": "^4.1.1",
5757
"core-js": "^3.27.1",
58+
"cross-env": "^7.0.3",
5859
"eslint": "^8.30.0",
5960
"eslint-config-airbnb-base": "^15.0.0",
6061
"eslint-config-prettier": "^8.5.0",
@@ -68,6 +69,7 @@
6869
"laravel-mix": "^6.0.49",
6970
"laravel-vite-plugin": "^0.7.2",
7071
"lodash": "^4.17.21",
72+
"nodemon": "^2.0.20",
7173
"postcss": "^8.4.20",
7274
"postcss-nesting": "^10.1.10",
7375
"prettier": "^2.8.1",
@@ -84,6 +86,9 @@
8486
"vite": "^4.0.2",
8587
"vite-plugin-eslint": "^1.8.1",
8688
"vite-plugin-inspect": "^0.7.10",
89+
"vite-plugin-pages": "^0.28.0",
90+
"vite-plugin-pages-sitemap": "^1.4.5",
91+
"vite-plugin-pwa": "^0.14.0",
8792
"vite-plugin-stylelint": "^4.1.4",
8893
"vue-content-loader": "^2.0.1",
8994
"vue-gtag-next": "^1.14.0",

resources/js/app.js

+5
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { ServerTable, ClientTable, EventBus } from 'v-tables-3';
1414
import VueGtag from 'vue-gtag-next';
1515
import * as Sentry from '@sentry/vue';
1616
import { BrowserTracing } from '@sentry/tracing';
17+
import { registerSW } from 'virtual:pwa-register';
1718

1819
axios.defaults.withCredentials = true;
1920

@@ -26,6 +27,10 @@ const VUE_SENTRY_ENABLED = SENTRY_ENABLED; // eslint-disable-line
2627
const VUE_SENTRY_FEEDBACK_ENABLED = SENTRY_FEEDBACK_ENABLED; // eslint-disable-line
2728
const VUE_ENVIRONMENT = ENVIRONMENT; // eslint-disable-line
2829

30+
const updateSW = registerSW({
31+
onOfflineReady() {},
32+
});
33+
2934
if (VUE_SENTRY_ENABLED) {
3035
Sentry.init({
3136
app,

resources/views/app.blade.php

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ function gtag(){dataLayer.push(arguments);}
1818
<meta name="description" content="{{ config('settings.description') }}">
1919
<meta name="keywords" content="{{ config('settings.keywords') }}">
2020
<meta name="author" content="{{ config('settings.author') }}">
21+
<link rel="icon" href="/favicon.ico">
22+
<link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180">
23+
<link rel="mask-icon" href="/mask-icon.svg" color="#FFFFFF">
24+
<meta name="theme-color" content="#ffffff">
2125
@vite(['resources/css/app.css'])
2226
</head>
2327
<body class="bg-gray-50 h-screen antialiased leading-none font-sans overflow-x-hidden overflow-y-auto">

tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"baseUrl": ".",
66
"paths": {
77
"@/*": ["./resources/js/*"]
8-
}
8+
},
9+
"types": ["vite-plugin-pwa/client"]
910
},
1011

1112
"references": [

vite.config.ts

+55
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import StylelintPlugin from 'vite-plugin-stylelint';
88
import Inspect from 'vite-plugin-inspect';
99
import legacy from '@vitejs/plugin-legacy';
1010
import sentryVitePlugin from '@sentry/vite-plugin';
11+
import Pages from 'vite-plugin-pages';
12+
import generateSitemap from 'vite-plugin-pages-sitemap';
13+
import { VitePWA } from 'vite-plugin-pwa';
1114
const fs = require('node:fs');
1215

1316
export default ({ mode }) => {
@@ -103,6 +106,58 @@ export default ({ mode }) => {
103106
splitVendorChunkPlugin(),
104107
Inspect(),
105108
SentryPlugin,
109+
Pages({
110+
onRoutesGenerated: async (routes) => {
111+
generateSitemap({
112+
hostname: process.env.VITE_APP_NAME,
113+
routes: [...routes],
114+
readable: true,
115+
exclude: ['/private'],
116+
allowRobots: false,
117+
filename: 'sitemap',
118+
});
119+
},
120+
}),
121+
VitePWA({
122+
registerType: 'autoUpdate',
123+
workbox: {
124+
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
125+
cleanupOutdatedCaches: true,
126+
sourcemap: true,
127+
},
128+
includeAssets: [
129+
'favicon.ico',
130+
'apple-touch-icon.png',
131+
'masked-icon.svg',
132+
],
133+
manifest: {
134+
name: process.env.VITE_APP_NAME,
135+
short_name: process.env.VITE_APP_SHORT_NAME,
136+
description: process.env.VITE_APP_DESC,
137+
theme_color: '#ffffff',
138+
icons: [
139+
{
140+
src: 'pwa-192x192.png',
141+
sizes: '192x192',
142+
type: 'image/png',
143+
},
144+
{
145+
src: 'pwa-512x512.png',
146+
sizes: '512x512',
147+
type: 'image/png',
148+
},
149+
{
150+
src: 'pwa-512x512.png',
151+
sizes: '512x512',
152+
type: 'image/png',
153+
purpose: 'any maskable',
154+
},
155+
],
156+
},
157+
devOptions: {
158+
enabled: true,
159+
},
160+
}),
106161
],
107162
sourcemap: true,
108163
server: devServer,

0 commit comments

Comments
 (0)