mirror of
https://github.com/Sonny93/my-links.git
synced 2025-12-08 14:43:24 +00:00
chore: append manifest in edge file only in prod env
This commit is contained in:
@@ -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'),
|
||||||
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -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
7
start/view.ts
Normal 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'));
|
||||||
Reference in New Issue
Block a user