Skip to content

Commit

Permalink
Merge pull request #112 from jeremykenedy/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
jeremykenedy authored Dec 30, 2022
2 parents 8c94f99 + 233911d commit 7237984
Show file tree
Hide file tree
Showing 7 changed files with 3,029 additions and 370 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ VITE_SERVER_HTTPS_CERT='/Users/ENTERYOURSYSTEMPATH/.config/valet/Certificates/la
VITE_SERVER_HOST='YOUR-PROJECT-URL.test'
VITE_SENTRY_IO_ENABLED="${SENTRY_IO_ENABLED}"
VITE_APP_ENV="${APP_ENV}"
VITE_APP_NAME="${APP_NAME}"

VITE_SERVER_ENABLED=true
VITE_SERVER_SECURE=false
Expand Down
3,326 changes: 2,957 additions & 369 deletions package-lock.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"babel-loader": "^9.1.0",
"chart.js": "^4.1.1",
"core-js": "^3.27.1",
"cross-env": "^7.0.3",
"eslint": "^8.30.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^8.5.0",
Expand All @@ -68,6 +69,7 @@
"laravel-mix": "^6.0.49",
"laravel-vite-plugin": "^0.7.2",
"lodash": "^4.17.21",
"nodemon": "^2.0.20",
"postcss": "^8.4.20",
"postcss-nesting": "^10.1.10",
"prettier": "^2.8.1",
Expand All @@ -84,6 +86,9 @@
"vite": "^4.0.2",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-inspect": "^0.7.10",
"vite-plugin-pages": "^0.28.0",
"vite-plugin-pages-sitemap": "^1.4.5",
"vite-plugin-pwa": "^0.14.0",
"vite-plugin-stylelint": "^4.1.4",
"vue-content-loader": "^2.0.1",
"vue-gtag-next": "^1.14.0",
Expand Down
5 changes: 5 additions & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ServerTable, ClientTable, EventBus } from 'v-tables-3';
import VueGtag from 'vue-gtag-next';
import * as Sentry from '@sentry/vue';
import { BrowserTracing } from '@sentry/tracing';
import { registerSW } from 'virtual:pwa-register';

axios.defaults.withCredentials = true;

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

const updateSW = registerSW({
onOfflineReady() {},
});

if (VUE_SENTRY_ENABLED) {
Sentry.init({
app,
Expand Down
4 changes: 4 additions & 0 deletions resources/views/app.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ function gtag(){dataLayer.push(arguments);}
<meta name="description" content="{{ config('settings.description') }}">
<meta name="keywords" content="{{ config('settings.keywords') }}">
<meta name="author" content="{{ config('settings.author') }}">
<link rel="icon" href="/favicon.ico">
<link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180">
<link rel="mask-icon" href="/mask-icon.svg" color="#FFFFFF">
<meta name="theme-color" content="#ffffff">
@vite(['resources/css/app.css'])
</head>
<body class="bg-gray-50 h-screen antialiased leading-none font-sans overflow-x-hidden overflow-y-auto">
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"baseUrl": ".",
"paths": {
"@/*": ["./resources/js/*"]
}
},
"types": ["vite-plugin-pwa/client"]
},

"references": [
Expand Down
55 changes: 55 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import StylelintPlugin from 'vite-plugin-stylelint';
import Inspect from 'vite-plugin-inspect';
import legacy from '@vitejs/plugin-legacy';
import sentryVitePlugin from '@sentry/vite-plugin';
import Pages from 'vite-plugin-pages';
import generateSitemap from 'vite-plugin-pages-sitemap';
import { VitePWA } from 'vite-plugin-pwa';
const fs = require('node:fs');

export default ({ mode }) => {
Expand Down Expand Up @@ -103,6 +106,58 @@ export default ({ mode }) => {
splitVendorChunkPlugin(),
Inspect(),
SentryPlugin,
Pages({
onRoutesGenerated: async (routes) => {
generateSitemap({
hostname: process.env.VITE_APP_NAME,
routes: [...routes],
readable: true,
exclude: ['/private'],
allowRobots: false,
filename: 'sitemap',
});
},
}),
VitePWA({
registerType: 'autoUpdate',
workbox: {
globPatterns: ['**/*.{js,css,html,ico,png,svg}'],
cleanupOutdatedCaches: true,
sourcemap: true,
},
includeAssets: [
'favicon.ico',
'apple-touch-icon.png',
'masked-icon.svg',
],
manifest: {
name: process.env.VITE_APP_NAME,
short_name: process.env.VITE_APP_SHORT_NAME,
description: process.env.VITE_APP_DESC,
theme_color: '#ffffff',
icons: [
{
src: 'pwa-192x192.png',
sizes: '192x192',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
},
{
src: 'pwa-512x512.png',
sizes: '512x512',
type: 'image/png',
purpose: 'any maskable',
},
],
},
devOptions: {
enabled: true,
},
}),
],
sourcemap: true,
server: devServer,
Expand Down

0 comments on commit 7237984

Please sign in to comment.