-
Notifications
You must be signed in to change notification settings - Fork 8
/
nuxt.config.js
243 lines (226 loc) · 6.89 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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
import path from 'path';
import { getSitemapRoutes } from './config/sitemap';
import { SITE_URL } from './constant';
const siteDefaultDescription =
'Mint Writing NFT for your content. Turn your stories into collectibles.'
const {
IS_TESTNET,
CI,
GA_TRACKING_ID,
SENTRY_DSN,
RELEASE,
} = process.env;
export default {
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: 'LikeCoin Creator Portal - LikeCoin',
meta: [
{ charset: 'utf-8' },
{ hid: 'viewport', name: 'viewport', content: 'width=device-width' },
{ hid: 'description', name: 'description', content: siteDefaultDescription },
{ hid: 'theme-color', name: 'theme-color', content: '#28646e' },
{ hid: 'og:site_name', property: 'og:site_name', content: 'LikeCoin Creator Portal - LikeCoin'},
{ hid: 'og:title', property: 'og:title', content: 'LikeCoin Creator Portal - LikeCoin' },
{ hid: 'og:image', property: 'og:image', content: 'https://app.like.co/images/og/default.png' },
{ hid: 'og:description', property: 'og:description', content: siteDefaultDescription },
{ hid: 'og:image_alt', property: 'og:image:alt', content: '#DePub' },
{ hid: 'og:image_width', property: 'og:image:width', content: '1200' },
{ hid: 'og:image_height', property: 'og:image:height', content: '630' },
{ name: 'format-detection', content: 'telephone=no' },
],
link: [
{ rel: 'icon', type: 'image/png', href: '/favicon.png' },
{ rel: 'preconnect', href: 'https://fonts.gstatic.com' },
{ rel: 'preload', href: 'https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=PT+Mono&display=swap', as: 'style' },
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;600&family=PT+Mono&display=swap' },
],
script: [{
hid: 'schema',
innerHTML: JSON.stringify([
{
'@context': 'https://schema.org',
'@type': 'WebSite',
name: 'LikeCoin Creator Portal',
url: 'https://app.like.co/',
},
{
'@context': 'http://www.schema.org',
'@type': 'Project',
name: 'LikeCoin',
url: 'https://like.co',
logo: 'https://like.co/logo.png',
},
]),
type: 'application/ld+json',
}],
__dangerouslyDisableSanitizersByTagID: { schema: ['innerHTML'] },
},
env: {
IS_TESTNET,
CI,
GA_TRACKING_ID,
SENTRY_DSN,
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [
'@likecoin/wallet-connector/dist/style.css',
'~/assets/css/global.css',
],
render: {
csp: {
enabled: true,
unsafeInlineCompatibility: true,
hashAlgorithm: 'sha256',
policies: {
'default-src': [
"'self'",
'data:',
'blob:',
'*',
],
'script-src': [
"'self'",
"'unsafe-inline'", // ignored by browser with sha support
"'wasm-unsafe-eval'",
"www.googletagmanager.com",
"https://unpkg.com/@google/model-viewer@3.0.2/",
],
'connect-src': [
"'self'",
'blob:',
'data:',
'*',
],
'frame-src': [
'verify.walletconnect.com',
'authcore.like.co',
'likecoin-integration-test.authcore.io',
],
'style-src': [
"'self'",
"'unsafe-inline'",
'fonts.googleapis.com',
],
'worker-src': [
"'self'",
'blob:',
],
'child-src': [
"'self'",
'blob:',
],
},
},
},
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [{ src: '~/plugins/gtag.client.ts', mode: 'client' }],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
// 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/stylelint
'@nuxtjs/stylelint-module',
// https://go.nuxtjs.dev/tailwindcss
'@nuxtjs/tailwindcss',
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
// https://i18n.nuxtjs.org
'@nuxtjs/i18n',
// https://sentry.nuxtjs.org
'@nuxtjs/sentry',
'@nuxtjs/sitemap',
// https://portal-vue.linusb.org/guide/installation.html#nuxt-module
'portal-vue/nuxt',
],
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {
browserBaseURL: '/api',
retry: { retries: 1 },
},
i18n: {
locales: [{
code: 'en',
file: 'en.json',
}],
defaultLocale: 'en',
langDir: '~/locales/',
vuex: false,
},
sentry: {
config: {
release: RELEASE,
},
tracing: {
// TODO: remove health check http calls from tracing
tracesSampleRate: IS_TESTNET ? 0.01 : 0.01,
browserTracing: {},
vueOptions: {
trackComponents: true,
},
vueRouterInstrumentationOptions: {
routeLabel: 'name',
},
},
publishRelease: !!RELEASE,
clientIntegrations: {
/* default integrations will still be added due to deep-merge */
ReportingObserver: false, // reporting is very noisy on CSP violation.
Replay: {},
},
clientConfig: {
ignoreErrors: [
'WebAssembly.instantiate',
'["@context"].toLowerCase',
],
replaysSessionSampleRate: IS_TESTNET ? 1.0 : 0.05,
replaysOnErrorSampleRate: IS_TESTNET ? 1.0 : 1.0,
},
},
sitemap: {
hostname: SITE_URL,
routes: getSitemapRoutes,
},
serverMiddleware: [{ path: '/api', handler: '~/server/index.ts' }],
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
transpile: [
'cosmjs-type',
'@cosmjs',
'@likecoin/iscn-js',
'@likecoin/wallet-connector',
'@walletconnect',
'@bundlr-network',
'@noble/curves',
'arbundle',
({ isLegacy }) => (isLegacy ? 'axios' : undefined),
],
extend(config, ctx) {
/* eslint-disable no-param-reassign */
if (!ctx.isDev) {
config.resolve.alias['bn.js'] = path.join(__dirname, './node_modules/bn.js');
}
if (ctx.isClient) {
config.resolve.alias['arbundles/web'] = path.join(__dirname, './node_modules/arbundles/build/web/esm/webIndex');
} else {
config.externals = {
'@bundlr-network/client': '@bundlr-network/client',
}
// config.resolve.alias['arbundles/node'] = path.join(__dirname, './node_modules/arbundles/build/node/cjs');
}
config.module.rules.push({
test: /\.mjs$/,
include: /node_modules/,
type: 'javascript/auto',
});
/* eslint-enable no-param-reassign */
},
},
server: {
host: process.env.NODE_ENV === 'production' ? '0' : 'localhost',
},
}