@dargmuesli/nuxt-vio 3.0.0-beta.17 → 3.0.0-beta.19

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,10 @@
3
3
  <div>
4
4
  {{ description }}
5
5
  </div>
6
- <pre v-if="stack && !runtimeConfig.public.isInProduction" v-html="stack" />
6
+ <pre
7
+ v-if="stack && !runtimeConfig.public.vio.isInProduction"
8
+ v-html="stack"
9
+ />
7
10
  </template>
8
11
 
9
12
  <script setup lang="ts">
@@ -28,7 +28,7 @@ const runtimeConfig = useRuntimeConfig()
28
28
 
29
29
  // computations
30
30
  const year = computed(() =>
31
- runtimeConfig.public.isTesting ? 1337 : new Date().getFullYear(),
31
+ runtimeConfig.public.vio.isTesting ? 1337 : new Date().getFullYear(),
32
32
  )
33
33
  </script>
34
34
 
@@ -16,6 +16,6 @@ export const useGetServiceHref = () => {
16
16
  isSsr,
17
17
  name,
18
18
  port,
19
- stagingHost: runtimeConfig.public.stagingHost,
19
+ stagingHost: runtimeConfig.public.vio.stagingHost,
20
20
  })
21
21
  }
package/nuxt.config.ts CHANGED
@@ -60,17 +60,19 @@ export default defineNuxtConfig({
60
60
  },
61
61
  runtimeConfig: {
62
62
  public: {
63
- googleAnalyticsId: '', // set via environment variable `NUXT_PUBLIC_GOOGLE_ANALYTICS_ID` only
64
63
  i18n: {
65
64
  baseUrl: BASE_URL,
66
65
  },
67
- isInProduction: process.env.NODE_ENV === 'production',
68
- isTesting: false,
69
- stagingHost:
70
- process.env.NODE_ENV !== 'production' &&
71
- !process.env.NUXT_PUBLIC_STACK_DOMAIN
72
- ? 'localhost:3000'
73
- : undefined,
66
+ vio: {
67
+ googleAnalyticsId: '', // set via environment variable `NUXT_PUBLIC_GOOGLE_ANALYTICS_ID` only
68
+ isInProduction: process.env.NODE_ENV === 'production',
69
+ isTesting: false,
70
+ stagingHost:
71
+ process.env.NODE_ENV !== 'production' &&
72
+ !process.env.NUXT_PUBLIC_STACK_DOMAIN
73
+ ? 'localhost:3000'
74
+ : undefined,
75
+ },
74
76
  },
75
77
  },
76
78
  typescript: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-vio",
3
- "version": "3.0.0-beta.17",
3
+ "version": "3.0.0-beta.19",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -10,7 +10,7 @@ export default defineNuxtPlugin((nuxtApp) => {
10
10
  {
11
11
  bootstrap: !!cookieControl.cookiesEnabledIds.value?.includes('ga'),
12
12
  config: {
13
- id: config.public.googleAnalyticsId,
13
+ id: config.public.vio.googleAnalyticsId,
14
14
  params: {
15
15
  cookie_flags: 'secure;samesite=strict',
16
16
  },
@@ -35,9 +35,9 @@ export const VIO_NUXT_BASE_CONFIG = ({
35
35
  siteName,
36
36
  stagingHost,
37
37
  }: {
38
- baseUrl: string
38
+ baseUrl?: string
39
39
  siteName: string
40
- stagingHost: string
40
+ stagingHost?: string
41
41
  }) => ({
42
42
  app: {
43
43
  head: {
@@ -47,14 +47,18 @@ export const VIO_NUXT_BASE_CONFIG = ({
47
47
  runtimeConfig: {
48
48
  public: {
49
49
  i18n: {
50
- baseUrl,
50
+ ...(baseUrl ? { baseUrl } : {}),
51
51
  },
52
52
  vio: {
53
- stagingHost:
54
- process.env.NODE_ENV !== 'production' &&
55
- !process.env.NUXT_PUBLIC_STACK_DOMAIN
56
- ? stagingHost
57
- : undefined,
53
+ ...(stagingHost
54
+ ? {
55
+ stagingHost:
56
+ process.env.NODE_ENV !== 'production' &&
57
+ !process.env.NUXT_PUBLIC_STACK_DOMAIN
58
+ ? stagingHost
59
+ : undefined,
60
+ }
61
+ : {}),
58
62
  },
59
63
  },
60
64
  },
@@ -72,6 +76,6 @@ export const VIO_NUXT_BASE_CONFIG = ({
72
76
  i18n: I18N_MODULE_CONFIG, // `langDir`, `lazy` and `locales` must be configured to extend a layer having lazy-loaded translations (https://v8.i18n.nuxtjs.org/guide/layers#locales)
73
77
  site: {
74
78
  name: siteName,
75
- url: baseUrl,
79
+ ...(baseUrl ? { url: baseUrl } : {}),
76
80
  },
77
81
  })