-
Notifications
You must be signed in to change notification settings - Fork 15
/
nuxt.config.js
210 lines (202 loc) · 7.42 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
import i18n from './plugins/i18n'
import ENV from './env'
// import path from 'path'
const metaTitle = '瞬MATATAKI—发布瞬间,灵感永存'
const metaDescription = '瞬MATATAKI是一个永久存储和版权确权的内容平台,通过IPFS协议保障内容的永久可访问和确权信息可查询。使用了Fan票来激励创作者、探索者、布道者共建未来的超级知识链接网络。'
const metaKeywords = '岛娘,小岛美奈子,唐飞虎,仙女座科技,瞬MATATAKI,智能公告牌,智能投资,裂变营销,价值投资,区块链,比特币,以太坊,去中心化社交,去中心化商店,去中心化,DApp,EOS,ETH,BTC,DAO'
const metaImage = 'https://smartsignature-img.oss-cn-hongkong.aliyuncs.com/avatar/2019/08/30/c1d6ae7ed4e6102cb45d0a8f656d5569.png'
// const resolve = (dir) => path.join(__dirname, dir)
export default {
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: '瞬MATATAKI',
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, viewport-fit=cover' },
// ---
{ hid: 'robots', name: 'robots', property: 'robots', content: 'index,follow' },
{ hid: 'copyright', name: 'copyright', property: 'copyright', content: 'Copyright © 2018-2021 ANDOROMEDA TECH.ltd' },
{ hid: 'description', name: 'description', content: metaDescription },
{ hid: 'keywords', name: 'keywords', content: metaKeywords },
/* <!-- Meta for Twitter Card --> */
{ hid: 'twitter:card', name: 'twitter:card', property: 'twitter:card', content: 'summary' },
{ hid: 'twitter:site', name: 'twitter:site', property: 'twitter:site', content: metaTitle },
{ hid: 'twitter:title', property: 'twitter:title', content: metaTitle },
{ hid: 'twitter:image', name: 'twitter:image', property: 'twitter:image', content: metaImage },
{ hid: 'twitter:description', name: 'description', property: 'twitter:description', content: metaDescription },
/* <!-- Meta for OpenGraph --> */
{ hid: 'og:type', name: 'og:type', property: 'og:type', content: 'website' },
{ hid: 'og:site_name', name: 'og:site_name', property: 'og:site_name', content: metaTitle },
{ hid: 'og:title', property: 'og:title', content: metaTitle },
{ hid: 'og:image', name: 'og:image', property: 'og:image', content: metaImage },
{ hid: 'og:description', name: 'description', property: 'og:description', content: metaDescription },
{ hid: 'og:type', name: 'og:type', property: 'og:type', content: 'article' }
/* end */
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
// { rel: 'stylesheet', type: 'text/css', href: '/theme/index.css' }, // element ui css
{ rel: 'stylesheet', type: 'text/css', href: 'https://cdnjs.cloudflare.com/ajax/libs/hover.css/2.3.1/css/hover-min.css' }
// { rel: 'stylesheet', type: 'text/css', href: '/vant/index.css' }, // vant ui css
],
script: [
{ src: '/bowl.min.js' },
{ src: '/bowlStore.js' }
]
},
loading: {
color: '#542DE0'
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [
'./assets/css/index.less'
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
'@/plugins/axios',
'@/plugins/combined-inject.js',
'@/plugins/vue_plugins.js',
'@/plugins/vue_components.js',
// '~/plugins/i18n.js',
'@/plugins/vue_directive.js',
'@/plugins/vue_lazyload.js',
{ src: '@/plugins/broadcastchannel.js', mode: 'client' },
{ src: '@/plugins/router.js', mode: 'client', ssr: false },
{ src: '@/plugins/element-ui', ssr: true },
{ src: '@/plugins/vant_ui', ssr: true },
{ src: '@/plugins/nossr', ssr: false },
{ src: '@/plugins/vue-mavon-editor', ssr: false },
{ src: '@/plugins/vue_scroll_reveal.js', ssr: false },
// { src: '~/plugins/fundebug.js', ssr: false },
{ src: '@/plugins/sentry.js', ssr: false },
{ src: '@/plugins/v-viewer.js', ssr: false },
{ src: '@/plugins/vue_echarts.js', ssr: false },
{ src: '@/plugins/build-info.js', ssr: false }
],
// 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/eslint
'@nuxtjs/eslint-module'
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
// https://go.nuxtjs.dev/pwa
'@nuxtjs/pwa',
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/eslint-module',
'@nuxtjs/style-resources',
['nuxt-i18n', i18n],
[
'@nuxtjs/component-cache',
{
max: 10000,
maxAge: 1000 * 60 * 60
}
],
'nuxt-ssr-cache',
['~/modules/nuxt-svg-sprite-loader.js', {
symbolId: 'icon-[name]'
}]
],
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {},
cache: {
useHostPrefix: false,
pages: ['/dapp', '/agreement', '/policy'],
store: {
// 使用内存来存储页面内容
type: 'memory',
// 最多缓存100个页面
max: 100,
// 缓存时间,秒
ttl: 60
}
},
// PWA module configuration: https://go.nuxtjs.dev/pwa
pwa: {
manifest: {
lang: 'en',
name: 'Matataki',
gcm_sender_id: '1011435306795'
}
},
styleResources: {
less: './assets/css/global.less'
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
analyze: false,
transpile: [/^element-ui/],
optimization: {
splitChunks: {
cacheGroups: {
editor: {
test: /node_modules[\\/]@matataki\/editor/,
chunks: 'all',
priority: 20,
name: () => {
return 'chunk-editor'
}
},
elementUI: {
test: /node_modules\/element-ui/,
chunks: 'all',
priority: 30,
name: () => {
return 'chunk-elementUI'
}
},
vant: {
test: /node_modules[\\/]vant/,
chunks: 'all',
priority: 30,
name: () => {
return 'chunk-vant'
}
},
echarts: {
test: /node_modules\/(echarts|zrender\/lib)/,
chunks: 'all',
priority: 20,
name: () => {
return 'chunk-echarts'
}
},
ethers: {
test: /node_modules[\\/]ethers/,
chunks: 'all',
priority: 20,
name: () => {
return 'chunk-ethers'
}
},
web3: {
test: /node_modules[\\/]web3/,
chunks: 'all',
priority: 20,
name: () => {
return 'chunk-web3'
}
},
// TODO: 有点问题 如果 priority 高于其他会有问题 小于又打包不进来
// utils: { // qs xss viewerjs
// test: /node_modules\/(qs\/lib|xss\/lib|viewerjs\/dist|bignumber\.js|weixin-js-sdk)/,
// chunks: 'all',
// priority: 10,
// name: () => {
// return 'chunk-utils'
// }
// },
}
}
},
extend (config, { isDev }) {
config.devtool = isDev && 'cheap-module-source-map'
}
},
env: ENV[process.env.NODE_ENV]
}