chore: append manifest in edge file only in prod env

This commit is contained in:
Sonny
2025-08-06 19:15:50 +02:00
parent 8b176e3d0e
commit d56bd1ef80
3 changed files with 18 additions and 5 deletions

View File

@@ -57,7 +57,11 @@ export default defineConfig({
| List of modules to import before starting the application. | List of modules to import before starting the application.
| |
*/ */
preloads: [() => import('#start/routes'), () => import('#start/kernel')], preloads: [
() => import('#start/routes'),
() => import('#start/kernel'),
() => import('#start/view'),
],
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------

View File

@@ -17,10 +17,6 @@
href='/favicon.png' href='/favicon.png'
type='image/png' type='image/png'
/> />
<link
rel='manifest'
href='/assets/manifest.webmanifest'
/>
<link <link
rel='apple-touch-icon' rel='apple-touch-icon'
href='/favicon.png' href='/favicon.png'
@@ -30,6 +26,11 @@
href='/favicon.png' href='/favicon.png'
/> />
<title inertia>MyLinks</title> <title inertia>MyLinks</title>
@if(nodeEnv === 'production')
<link
rel='manifest'
href='/assets/manifest.webmanifest'
/>
<script defer> <script defer>
if('serviceWorker' in navigator) { if('serviceWorker' in navigator) {
window.addEventListener('load', () => { window.addEventListener('load', () => {
@@ -37,6 +38,7 @@
}) })
} }
</script> </script>
@endif
@routes() @routes()
@inertiaHead() @inertiaHead()

7
start/view.ts Normal file
View File

@@ -0,0 +1,7 @@
import env from '#start/env';
import edge from 'edge.js';
/**
* Define a global property
*/
edge.global('nodeEnv', env.get('NODE_ENV'));