-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
93 lines (83 loc) · 2.36 KB
/
nuxt.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// https://nuxt.com/docs/api/configuration/nuxt-config
const getSiteUrl = () => {
if (process.env.VERCEL_ENV === "preview") {
return `https://${process.env.VERCEL_URL}`;
}
if (process.env.VERCEL_ENV === undefined) {
const nuxtDevConfig = process.env.__NUXT_DEV__;
let networkAddress;
if (nuxtDevConfig) {
const parsedConfig = JSON.parse(nuxtDevConfig);
networkAddress = parsedConfig?.proxy?.urls?.find(
(addr: any) => addr.type === "network"
)?.url;
if (networkAddress?.endsWith("/")) {
networkAddress = networkAddress.slice(0, -1);
}
}
return networkAddress || "http://localhost:3000";
}
return "https://certificados.hemocione.com.br";
};
const getCurrentEnv = () => {
if (process.env.VERCEL_ENV === "preview") {
return "dev";
}
if (process.env.VERCEL_ENV === "production") {
return "prod";
}
return "dev";
};
const siteUrl = getSiteUrl();
const currentEnv = getCurrentEnv();
export default defineNuxtConfig({
runtimeConfig: {
public: {
siteUrl: siteUrl,
linkedinOrganizationId: 64875007,
signatureImageUrl: process.env.SIGNATURE_URL || "/utils/signature.svg",
},
resend: {
apiKey: process.env.RESEND_API_KEY || "key",
},
mongodbUri: process.env.MONGODB_URI || "mongodb://localhost:27017/hemocione-certificados",
currentEnv: currentEnv,
secret: process.env.SECRET || "secret",
},
devtools: { enabled: true },
site: {
url: siteUrl,
name: "Hemocione Certificados",
env: currentEnv,
indexable: false, // Prevent search engines from indexing the site. Certificates are not something that should be indexed.
},
css: ["~/assets/css/main.css", "~/assets/css/transitions.css"],
compatibilityDate: "2024-07-29",
modules: [
"@nuxt/image",
"@nuxtjs/seo",
"@pinia/nuxt",
"@nuxtjs/google-fonts",
"nuxt-vercel-analytics",
"nuxt-bugsnag"
],
googleFonts: {
families: {
Roboto: [100, 300, 400, 500, 700, 900],
},
},
experimental: {
componentIslands: true,
},
bugsnag: {
publishRelease: true,
disableLog: false, // might activate later
baseUrl: siteUrl,
config: {
apiKey: process.env.BUGSNAG_API_KEY,
enabledReleaseStages: ["prod", "dev"],
releaseStage: currentEnv,
appVersion: `${currentEnv}-${process.env.VERCEL_GIT_COMMIT_SHA}`,
},
},
});