-
Notifications
You must be signed in to change notification settings - Fork 2
/
nuxt.config.js
214 lines (195 loc) · 6.04 KB
/
nuxt.config.js
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
const environments = {
mirage: process.env.NUXT_ENV_BASE_URL_LOCAL_MIRAGE,
mongo: process.env.NUXT_ENV_BASE_URL_LOCAL_MONGO,
stage: process.env.NUXT_ENV_BASE_URL_STAGE,
production: process.env.NUXT_ENV_BASE_URL,
};
export default {
tailwindcss: {
cssPath: '~/assets/style/main.scss',
configPath: 'tailwind.config.js',
},
// Target: https://go.nuxtjs.dev/config-target
target: 'server',
// Global page headers: https://go.nuxtjs.dev/config-head
head(context) {
return {
titleTemplate: (titleChunk) =>
titleChunk ? `${titleChunk} | Ocean Pearl` : 'Ocean Pearl',
htmlAttrs: {
lang: 'en',
'data-theme': context.$cookies.get('theme') ?? 'light',
},
meta: [
{ charset: 'utf-8' },
{
name: 'viewport',
content: 'width=device-width, initial-scale=1',
},
{
hid: 'description',
name: 'description',
content:
'Community-based project tracking platform for the Ocean Protocol ecosystem with an early focus on the OceanDAO community.',
},
{ hid: 'robots', name: 'robots', content: process.env.NUXT_ENV_ROBOTS },
{ hid: 'theme-color', name: 'theme-color', content: '#BB2C75' },
{ hid: 'og:type', property: 'og:type', content: 'website' },
{ hid: 'og:title', property: 'og:title', content: 'Ocean Pearl' },
{
hid: 'og:description',
property: 'og:description',
content:
'Community-based project tracking platform for the Ocean Protocol ecosystem with an early focus on the OceanDAO community.',
},
{
hid: 'og:image',
property: 'og:image',
content: `${process.env.NUXT_ENV_ROOT_URL}/pearl-background.jpg`,
},
{ hid: 'og:image:width', property: 'og:image:width', content: 1920 },
{ hid: 'og:image:height', property: 'og:image:height', content: 1080 },
{
hid: 'og:image:alt',
property: 'og:image:alt',
content: 'Ocean Pearl Wallpaper',
},
{
hid: 'og:site_name',
property: 'og:site_name',
content: 'Ocean Pearl',
},
{ hid: 'twitter:card', property: 'twitter:card', content: 'summary' },
{
hid: 'twitter:title',
property: 'twitter:title',
content: 'Ocean Pearl',
},
{
hid: 'twitter:description',
property: 'twitter:description',
content:
'Community-based project tracking platform for the Ocean Protocol ecosystem with an early focus on the OceanDAO community.',
},
{
hid: 'twitter:image',
property: 'twitter:image',
content: `${process.env.NUXT_ENV_ROOT_URL}/pearl-background.jpg`,
},
{
hid: 'twitter:image:width',
property: 'twitter:image:width',
content: 1920,
},
{
hid: 'twitter:image:height',
property: 'twitter:image:height',
content: 1080,
},
{
hid: 'twitter:site',
property: 'twitter:site',
content: '@oceanpearlio',
},
{
hid: 'twitter:creator',
property: 'twitter:creator',
content: '@oceanpearlio',
},
],
link: [{ rel: 'icon', type: 'image/png', href: '/favicon.png' }],
};
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
'@/plugins/mirage.js',
'@/plugins/vue-touch',
'@/plugins/vue-dompurify',
{ src: '@/plugins/vue-globals', ssr: true },
{ src: '@/plugins/plausible', ssr: false },
{ src: '@/plugins/ui-theme', ssr: false },
],
// https://nuxtjs.org/blog/moving-from-nuxtjs-dotenv-to-runtime-config
publicRuntimeConfig: {
rootURL: process.env.NUXT_ENV_ROOT_URL,
baseURL: process.env.NUXT_ENV_BASE_URL || 'http://localhost:3000',
plausibleDomain: process.env.NUXT_ENV_PLAUSIBLE_DOMAIN,
infuraId: process.env.NUXT_ENV_INFURA_ID,
web3Provider: {
ethereum: process.env.NUXT_ENV_WEB3_ETHEREUM,
polygon: process.env.NUXT_ENV_WEB3_POLYGON,
bsc: process.env.NUXT_ENV_WEB3_BSC,
},
},
ssr: process.env.NODE_ENV !== 'mirage', // Disable Server Side rendering for development because of miragejs
env: {
useMirage: process.env.NODE_ENV === 'mirage',
},
axios: {
baseURL: environments[process.env.NODE_ENV],
},
// Auto import components: https://go.nuxtjs.dev/config-components
components: false,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
// https://go.nuxtjs.dev/typescript
'@nuxt/typescript-build',
// https://go.nuxtjs.dev/tailwindcss
'@nuxtjs/tailwindcss',
// https://github.com/nuxt-community/date-fns-module
'@nuxtjs/date-fns',
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
'nuxt-i18n',
'@nuxtjs/axios',
'cookie-universal-nuxt',
'@nuxtjs/sitemap',
'@nuxt/content',
],
content: {
liveEdit: false,
},
sitemap: {
filter({ routes }) {
return routes.filter((route) => route.component.endsWith('.vue'));
},
},
dateFns: {
locales: ['en-US'],
fallbackLocale: 'en-US',
},
i18n: {
locales: [
{
code: 'en-US',
name: 'English',
file: 'en.json',
},
],
lazy: true,
langDir: '~/assets/locales/',
defaultLocale: 'en-US',
},
render: {
bundleRenderer: {
shouldPreload: (file, type) => {
// type is inferred based on the file extension.
// https://fetch.spec.whatwg.org/#concept-request-destination
if (type === 'script' || type === 'style') {
return true;
}
if (type === 'font') {
return (
file.includes('Poppins-Bold') || file.includes('Poppins-Regular')
);
}
return false;
},
},
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {},
};