Skip to content

Commit f2b3749

Browse files
committed
temp
1 parent d6c99e9 commit f2b3749

File tree

5 files changed

+87
-55
lines changed

5 files changed

+87
-55
lines changed
Binary file not shown.

examples/nuxt/nuxt.config.js

+47-39
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,54 @@
1-
export default {
2-
// Target: https://go.nuxtjs.dev/config-target
3-
target: 'static',
1+
import * as dotenv from 'dotenv';
2+
dotenv.config({ path: '../../.env' });
43

5-
// Global page headers: https://go.nuxtjs.dev/config-head
6-
head: {
7-
title: 'nuxt',
8-
htmlAttrs: {
9-
lang: 'en'
4+
export default {
5+
// Target: https://go.nuxtjs.dev/config-target
6+
target: 'static',
7+
head: {
8+
title: 'Userback nuxt example',
9+
htmlAttrs: {
10+
lang: 'en',
11+
},
12+
meta: [
13+
{ charset: 'utf-8' },
14+
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
15+
{ hid: 'description', name: 'description', content: '' },
16+
{ name: 'format-detection', content: 'telephone=no' },
17+
],
18+
link: [
19+
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
20+
],
1021
},
11-
meta: [
12-
{ charset: 'utf-8' },
13-
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
14-
{ hid: 'description', name: 'description', content: '' },
15-
{ name: 'format-detection', content: 'telephone=no' }
16-
],
17-
link: [
18-
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
19-
]
20-
},
22+
css: [],
2123

22-
// Global CSS: https://go.nuxtjs.dev/config-css
23-
css: [
24-
],
25-
26-
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
27-
plugins: [
28-
],
24+
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
25+
plugins: [
26+
'~/plugins/userback.client.js',
27+
],
2928

30-
// Auto import components: https://go.nuxtjs.dev/config-components
31-
components: true,
29+
// Auto import components: https://go.nuxtjs.dev/config-components
30+
components: true,
3231

33-
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
34-
buildModules: [
35-
// https://go.nuxtjs.dev/typescript
36-
'@nuxt/typescript-build',
37-
],
32+
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
33+
buildModules: [
34+
// https://go.nuxtjs.dev/typescript
35+
'@nuxt/typescript-build',
36+
],
3837

39-
// Modules: https://go.nuxtjs.dev/config-modules
40-
modules: [
41-
],
38+
// Modules: https://go.nuxtjs.dev/config-modules
39+
modules: [
40+
// '@userback/vue',
41+
],
4242

43-
// Build Configuration: https://go.nuxtjs.dev/config-build
44-
build: {
45-
}
46-
}
43+
// Build Configuration: https://go.nuxtjs.dev/config-build
44+
build: {
45+
},
46+
alias: {
47+
// @FIXME: Appears to be an issue with .mjs not being loaded correctly
48+
'@userback/vue': '@userback/vue/dist/vue.js',
49+
},
50+
env: {
51+
UB_TOKEN: process.env?.VITE_UB_TOKEN,
52+
UB_DOMAIN: process.env?.VITE_UB_DOMAIN,
53+
},
54+
};

examples/nuxt/package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "nuxt",
2+
"name": "example-nuxt",
33
"version": "0.1.4",
44
"private": true,
55
"scripts": {
@@ -9,6 +9,8 @@
99
"generate": "nuxt generate"
1010
},
1111
"dependencies": {
12+
"@userback/vue": "workspace:^",
13+
"@userback/widget": "workspace:^",
1214
"core-js": "^3.25.3",
1315
"nuxt": "^2.15.8",
1416
"vue": "^2.7.10",
@@ -17,6 +19,7 @@
1719
},
1820
"devDependencies": {
1921
"@nuxt/types": "^2.15.8",
20-
"@nuxt/typescript-build": "^2.1.0"
22+
"@nuxt/typescript-build": "^2.1.0",
23+
"dotenv": "^16.0.3"
2124
}
2225
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Vue from 'vue';
2+
import UserbackPlugin from '@userback/vue';
3+
// import { defineNuxtPlugin } from '@nuxtjs/composition-api';
4+
5+
const token = process.env.UB_TOKEN;
6+
const domain = process.env.UB_DOMAIN;
7+
8+
Vue.use(UserbackPlugin, { token, domain });
9+
//export default defineNuxtPlugin((nuxtApp) => {
10+
// nuxtApp.vueApp.use(UserbackPlugin, { token, domain })
11+
//})

yarn.lock

+24-14
Original file line numberDiff line numberDiff line change
@@ -5524,6 +5524,13 @@ __metadata:
55245524
languageName: node
55255525
linkType: hard
55265526

5527+
"dotenv@npm:^16.0.3":
5528+
version: 16.0.3
5529+
resolution: "dotenv@npm:16.0.3"
5530+
checksum: afcf03f373d7a6d62c7e9afea6328e62851d627a4e73f2e12d0a8deae1cd375892004f3021883f8aec85932cd2834b091f568ced92b4774625b321db83b827f8
5531+
languageName: node
5532+
linkType: hard
5533+
55275534
"dotenv@npm:^9.0.2":
55285535
version: 9.0.2
55295536
resolution: "dotenv@npm:9.0.2"
@@ -6381,6 +6388,23 @@ __metadata:
63816388
languageName: unknown
63826389
linkType: soft
63836390

6391+
"example-nuxt@workspace:examples/nuxt":
6392+
version: 0.0.0-use.local
6393+
resolution: "example-nuxt@workspace:examples/nuxt"
6394+
dependencies:
6395+
"@nuxt/types": ^2.15.8
6396+
"@nuxt/typescript-build": ^2.1.0
6397+
"@userback/vue": "workspace:^"
6398+
"@userback/widget": "workspace:^"
6399+
core-js: ^3.25.3
6400+
dotenv: ^16.0.3
6401+
nuxt: ^2.15.8
6402+
vue: ^2.7.10
6403+
vue-server-renderer: ^2.7.10
6404+
vue-template-compiler: ^2.7.10
6405+
languageName: unknown
6406+
linkType: soft
6407+
63846408
"example-react-class@workspace:examples/react-class":
63856409
version: 0.0.0-use.local
63866410
resolution: "example-react-class@workspace:examples/react-class"
@@ -9422,20 +9446,6 @@ __metadata:
94229446
languageName: node
94239447
linkType: hard
94249448

9425-
"nuxt@workspace:examples/nuxt":
9426-
version: 0.0.0-use.local
9427-
resolution: "nuxt@workspace:examples/nuxt"
9428-
dependencies:
9429-
"@nuxt/types": ^2.15.8
9430-
"@nuxt/typescript-build": ^2.1.0
9431-
core-js: ^3.25.3
9432-
nuxt: ^2.15.8
9433-
vue: ^2.7.10
9434-
vue-server-renderer: ^2.7.10
9435-
vue-template-compiler: ^2.7.10
9436-
languageName: unknown
9437-
linkType: soft
9438-
94399449
"object-assign@npm:^4.0.1, object-assign@npm:^4.1.0, object-assign@npm:^4.1.1":
94409450
version: 4.1.1
94419451
resolution: "object-assign@npm:4.1.1"

0 commit comments

Comments
 (0)