-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathnuxt.config.js
303 lines (301 loc) · 8.67 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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
import env from './config/env';
import sitemap from './config/sitemap';
let pattern = false;
const plugins = [
[
'component',
{
libraryName: 'element-ui',
styleLibraryName: 'theme-chalk'
}
]
];
if (process.env.NODE_ENV !== 'production') {
pattern = true;
} else {
// @ts-ignore
plugins.push('transform-remove-console');
pattern = false;
}
console.log(process.env.NODE_ENV);
console.log(pattern);
const Timestamp = new Date().getTime();
export default {
mode: 'universal',
env: {
NUXT_ENV: env[process.env.MODE]
},
head: {
htmlAttrs: {
prefix: 'og:http://ogp.me/ns#'
},
title: 'Welcome to IBAX Network | IBAX',
meta: [
{ charset: 'utf-8' },
{
name: 'robots',
content: 'index, follow'
},
{
hid: 'Pragma',
'http-equiv': 'Pragma',
content: 'no-cache'
},
{
hid: 'Cache-Control',
'http-equiv': 'Cache-Control',
content: 'no-cache'
},
{
name: 'viewport',
content:
'width=device-width, initial-scale=1,maximum-scale=1.0, user-scalable=0'
},
{ name: 'format-detection', content: 'telephone=no' },
{ name: 'mobile-web-app-capable', content: 'no' },
{
hid: 'apple-mobile-web-app-title',
name: 'apple-mobile-web-app-title',
content: 'IBAX Network'
},
{
hid: 'og:url',
property: 'og:url',
content: 'https://ibax.io'
},
{
hid: 'og:title',
property: 'og:title',
content: `Welcome to IBAX Network`
},
{
hid: 'twitter:title',
property: 'twitter:title',
content: `Welcome to IBAX Network`
},
{
hid: 'og:image',
property: 'og:image',
content: 'https://ibax.io/image/mate-twitter.png'
},
{
hid: 'twitter:image',
property: 'twitter:image',
content: 'https://ibax.io/image/mate-twitter.png'
},
{
hid: 'twitter:type',
property: 'twitter:card',
content: 'summary_large_image'
},
{
hid: 'twitter:site',
property: 'twitter:site',
content: '@IbaxNetwork'
},
{
hid: 'twitter:creator',
property: 'twitter:creator',
content: '@IbaxNetwork'
},
{
hid: 'twitter:description',
property: 'twitter:description',
content: 'Secure and high performance Web 3.0 blockchain infrastructure'
},
{
hid: 'og:type',
property: 'og:type',
content: 'website'
},
{
hid: 'og:site_name',
property: 'og:site_name',
content: 'IBAX Network'
},
{
hid: 'keywords',
name: 'keywords',
content:
'IBAX, Crypto Currency, bitcoin, Cross-Chain, crypto, DeFi, Dapps,blockchain technology, corelayer technology, decentralized application, distributed ledger, IBAX AMA, blockChain BaaS, BaaS, blockchain as a service, mining, web3, web 3.0, W3,blockchain, metaverse, DAO'
},
{
hid: 'description',
name: 'description',
content: `IBAX is a fast, efficient, transparent, decentralized infrastructure public blockchain network. Everyone can create a DAO or customizable consensus mechanism ecosystem using IBAX's BaaS platform. Weaver enables low-code development and zero-code coin issuance through simple drag-and-drop , which greatly reduces the time and threshold for developing DApps.`
},
{
hid: 'og:description',
property: 'og:description',
content: `IBAX is a fast, efficient, transparent, decentralized infrastructure public blockchain network. Everyone can create a DAO or customizable consensus mechanism ecosystem using IBAX's BaaS platform. Weaver enables low-code development and zero-code coin issuance through simple drag-and-drop , which greatly reduces the time and threshold for developing DApps.`
},
{
hid: 'ie',
'http-equiv': 'X-UA-Compatible',
content: 'IE=11; IE=10; IE=9; IE=8; IE=EDGE'
},
{
hid: 'edge',
'http-equiv': 'X-UA-Compatible',
content: 'IE=edge,chrome=1'
}
],
link: [
{ rel: 'shortcut icon', href: '/favicon.ico' },
{ rel: 'apple-touch-icon', href: '/favicon.ico' },
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'stylesheet', type: 'text/css', href: '/animate/animate.min.css' },
{
rel: 'stylesheet',
type: 'text/css',
href: '/icon/iconfont.css'
}
],
script: [
{
async: 'async',
src: 'https://www.googletagmanager.com/gtag/js?id=G-3P74G75LD1'
}
]
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: ['element-ui/lib/theme-chalk/display.css', './assets/sass/index.scss'],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
'@/plugins/element-ui',
'@/plugins/i18n.js',
'@/plugins/mixin.js',
'@/plugins/http.js',
'@/plugins/day.js',
{ src: '@/plugins/analytics.js', ssr: false },
// { src: '@/plugins/clarity.js', ssr: false },
{ src: '@/plugins/wow.js', ssr: false },
{ src: '@/plugins/vueSroll.js', ssr: false },
{ src: '@/plugins/vueP5.js', ssr: false },
{ src: '@/plugins/shareon.js', ssr: false },
{ src: '@/plugins/vueQr.js', ssr: false },
{ src: '@/plugins/copy.js', ssr: false },
{ src: '@/plugins/swiper.js', ssr: false },
'@/plugins/vueSlickCarousel.js'
],
// Auto import components: https://go.nuxtjs.dev/config-components
components: true,
/* server: {
https: {
key: fs.readFileSync(path.resolve(__dirname, 'data/cert/privkey.pem')),
cert: fs.readFileSync(path.resolve(__dirname, 'data/cert/fullchain.pe'))
}
}, */
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
// https://go.nuxtjs.dev/eslint
'@nuxtjs/eslint-module',
// https://go.nuxtjs.dev/stylelint
'@nuxtjs/stylelint-module'
],
router: {
middleware: ['auth', 'i18n', 'router'],
linkActiveClass: 'nav-active-link'
},
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
// https://go.nuxtjs.dev/pwa
'@nuxtjs/pwa',
// https://go.nuxtjs.dev/content
'@nuxt/content',
'@nuxtjs/sitemap',
'nuxt-client-init-module',
'nuxtjs-microsoft-clarity'
],
microsoftClarity: {
// Options
id: 'hberjxzdhk'
},
sitemap: !pattern ? sitemap : '',
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {
// baseUrl: 'https://ibax.io:9095/api',
proxy: pattern,
prefix: '/api',
retry: { retries: 3 },
credentials: true
},
proxy: {
'/api': {
target: 'https://testnet-us-34-86-177-19.ibax.io:9095',
// target: 'http://192.168.1.191:8888',
// target: 'https://ibax.io',
changeOrigin: true,
pathRewrite: {
'^/api/*': ''
}
}
},
// PWA module configuration: https://go.nuxtjs.dev/pwa
pwa: {
icon: {
source: '/icon.png',
fileName: 'icon.png'
},
manifest: {
lang: 'en'
}
},
// Content module configuration: https://go.nuxtjs.dev/config-content
content: {},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
postcss: null,
// extractCSS: false,
extractCSS: !pattern,
optimization: {
splitChunks: {
cacheGroups: {
styles: {
name: 'styles',
test: /\.(css|vue)$/,
chunks: 'all',
enforce: true
}
}
}
},
transpile: [/^element-ui/],
cssSourceMap: pattern,
cache: pattern,
build: {
hotMiddleware: {
client: {
// turn off client overlay when errors are present
overlay: false
}
}
},
babel: {
plugins
},
filenames: {
app: ({ isDev }) => (isDev ? '[name].js' : '[chunkhash].js'),
chunk: ({ isDev }) => (isDev ? '[name].js' : '[id].[name].js'),
img: ({ isDev }) => (isDev ? '[path][name].[ext]' : 'img/[hash:7].[ext]'),
font: ({ isDev }) =>
isDev ? '[path][name].[ext]' : 'fonts/[hash:7].[ext]',
video: ({ isDev }) =>
isDev ? '[path][name].[ext]' : 'videos/[hash:7].[ext]'
},
extend(config, ctx) {
config.output.filename = `js/[name].${Timestamp}.js`;
config.output.chunkFilename = `js/[name].${Timestamp}.js`;
//
if (ctx.isClient) {
config.devtool = pattern ? 'eval-source-map' : 'none';
}
//
if (ctx.isServer) {
config.devtool = pattern ? 'eval-source-map' : 'none';
}
}
}
};