this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Conditionally use error logging

Totally not needed on local dev at all. Disable for prod for now

+32 -5
+1
.env.production
··· 1 + VITE_APP_ENV=production
+8 -5
index.html
··· 6 6 name="viewport" 7 7 content="width=device-width, initial-scale=1, viewport-fit=cover" 8 8 /> 9 - <title>Phanpy</title> 9 + <title><{ VITE_CLIENT_NAME }></title> 10 10 <meta 11 11 name="description" 12 12 content="Minimalistic opinionated Mastodon web client" ··· 14 14 <meta name="color-scheme" content="dark light" /> 15 15 <link rel="icon" type="image/svg+xml" href="/favicon.svg" /> 16 16 <link rel="apple-touch-icon" href="/apple-touch-icon.png" /> 17 - <meta name="apple-mobile-web-app-title" content="Phanpy" /> 17 + <meta name="apple-mobile-web-app-title" content="<{ VITE_CLIENT_NAME }>" /> 18 18 <meta name="apple-mobile-web-app-capable" content="yes" /> 19 19 <meta name="mobile-web-app-capable" content="yes" /> 20 - <link rel="canonical" href="https://phanpy.social" /> 20 + <link rel="canonical" href="<{ VITE_WEBSITE }>" /> 21 21 <meta 22 22 name="theme-color" 23 23 content="#fff" ··· 28 28 content="#242526" 29 29 media="(prefers-color-scheme: dark)" 30 30 /> 31 - <script> 31 + <script vite-if="import.meta.env.VITE_APP_ENV === production"> 32 + var isDev = /dev\./.test(window.location.hostname); 32 33 var _rollbarConfig = { 33 34 accessToken: 'ec3e07829d324a29abf6c83472a9740d', 34 35 captureUncaught: true, 35 36 captureUnhandledRejections: true, 37 + enabled: isDev, 38 + hostSafeList: ['dev.phanpy.social', 'phanpy.social'], 36 39 payload: { 37 - environment: 'production', 40 + environment: isDev ? 'development' : 'production', 38 41 }, 39 42 }; 40 43 // Rollbar Snippet
+20
package-lock.json
··· 32 32 "postcss-dark-theme-class": "~0.7.3", 33 33 "twitter-text": "~3.1.0", 34 34 "vite": "~4.0.3", 35 + "vite-plugin-html-env": "~1.2.7", 35 36 "vite-plugin-pwa": "~0.14.0", 36 37 "workbox-cacheable-response": "~6.5.4", 37 38 "workbox-expiration": "~6.5.4", ··· 5406 5407 } 5407 5408 } 5408 5409 }, 5410 + "node_modules/vite-plugin-html-env": { 5411 + "version": "1.2.7", 5412 + "resolved": "https://registry.npmjs.org/vite-plugin-html-env/-/vite-plugin-html-env-1.2.7.tgz", 5413 + "integrity": "sha512-vdTnKtuBeB8Zp93DCbN0Qjf4odW2msVRq45r7lGKA6nwQGJFj6YemU54u3xPPkvDeZhG8DEEU64xbLwzVEBilQ==", 5414 + "dev": true, 5415 + "engines": { 5416 + "node": ">=12.0.0" 5417 + }, 5418 + "peerDependencies": { 5419 + "vite": "*" 5420 + } 5421 + }, 5409 5422 "node_modules/vite-plugin-pwa": { 5410 5423 "version": "0.14.0", 5411 5424 "resolved": "https://registry.npmjs.org/vite-plugin-pwa/-/vite-plugin-pwa-0.14.0.tgz", ··· 9596 9609 "resolve": "^1.22.1", 9597 9610 "rollup": "^3.7.0" 9598 9611 } 9612 + }, 9613 + "vite-plugin-html-env": { 9614 + "version": "1.2.7", 9615 + "resolved": "https://registry.npmjs.org/vite-plugin-html-env/-/vite-plugin-html-env-1.2.7.tgz", 9616 + "integrity": "sha512-vdTnKtuBeB8Zp93DCbN0Qjf4odW2msVRq45r7lGKA6nwQGJFj6YemU54u3xPPkvDeZhG8DEEU64xbLwzVEBilQ==", 9617 + "dev": true, 9618 + "requires": {} 9599 9619 }, 9600 9620 "vite-plugin-pwa": { 9601 9621 "version": "0.14.0",
+1
package.json
··· 34 34 "postcss-dark-theme-class": "~0.7.3", 35 35 "twitter-text": "~3.1.0", 36 36 "vite": "~4.0.3", 37 + "vite-plugin-html-env": "~1.2.7", 37 38 "vite-plugin-pwa": "~0.14.0", 38 39 "workbox-cacheable-response": "~6.5.4", 39 40 "workbox-expiration": "~6.5.4",
+2
vite.config.js
··· 2 2 import { execSync } from 'child_process'; 3 3 import { resolve } from 'path'; 4 4 import { defineConfig, loadEnv, splitVendorChunkPlugin } from 'vite'; 5 + import VitePluginHtmlEnv from 'vite-plugin-html-env'; 5 6 import { VitePWA } from 'vite-plugin-pwa'; 6 7 7 8 const { VITE_CLIENT_NAME: CLIENT_NAME, NODE_ENV } = loadEnv( ··· 21 22 plugins: [ 22 23 preact(), 23 24 splitVendorChunkPlugin(), 25 + VitePluginHtmlEnv(), 24 26 VitePWA({ 25 27 manifest: { 26 28 name: CLIENT_NAME,