diff --git a/src/app.html b/src/app.html index 6d343c1..50c86a5 100644 --- a/src/app.html +++ b/src/app.html @@ -81,12 +81,6 @@ - - diff --git a/src/lib/components/Analytics.svelte b/src/lib/components/Analytics.svelte new file mode 100644 index 0000000..0b6fcd4 --- /dev/null +++ b/src/lib/components/Analytics.svelte @@ -0,0 +1,13 @@ + + + + {#if !isDevelopment()} + + {/if} + diff --git a/src/lib/utils/env.js b/src/lib/utils/env.js index 5dde7bb..5d1b53b 100644 --- a/src/lib/utils/env.js +++ b/src/lib/utils/env.js @@ -4,4 +4,8 @@ function appVersion() { return APP_VERSION; } -export { appVersion }; +function isDevelopment() { + return import.meta.env.MODE === 'development'; +} + +export { appVersion, isDevelopment }; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 244c409..38404ed 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -4,6 +4,7 @@ import Header from '$lib/components/Header.svelte'; import Footer from '$lib/components/Footer.svelte'; + import Analytics from '$lib/components/Analytics.svelte'; let mounted = false; @@ -14,6 +15,8 @@ } + + {#if mounted}