This repository has been archived by the owner on Jun 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
nuxt.config.js
149 lines (144 loc) · 5.53 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
import path from 'path'
import webpack from 'webpack'
import SpriteLoaderPlugin from 'svg-sprite-loader/plugin'
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
import env from './env'
function genENV() {
const keys = Object.keys(env.production)
const result = {}
keys.forEach((item) => {
result[item] = env[process.env.NODE_ENV][item]
})
return result
}
function resolve(dir) {
return path.join(__dirname, dir)
}
export default {
mode: 'universal',
/*
** Headers of the page
*/
head: {
// title: process.env.npm_package_name || '',
title: '瞬MATATAKI',
meta: [
{ hid: 'robots', name: 'robots', property: 'robots', content: 'index,follow' },
{ hid: 'copyright', name: 'copyright', property: 'copyright', content: 'Copyright © 2018-2019 ANDOROMEDA TECH.ltd' },
{ hid: 'description', name: 'description', property: 'description', content: '瞬MATATAKI是一个永久存储和版权确权的内容平台,通过IPFS协议保障内容的永久可访问和确权信息可查询。使用了通证经济来激励创作者、探索者、布道者共建未来的超级知识链接网络。' },
{ hid: 'keywords', name: 'keywords', content: '岛娘,小岛美奈子,唐飞虎,仙女座科技,瞬MATATAKI,智能公告牌,智能投资,裂变营销,价值投资,区块链,比特币,以太坊,去中心化社交,去中心化商店,去中心化,DApp,EOS' },
/* <!-- 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: '瞬MATATAKI—发布瞬间,灵感永存' },
{ hid: 'twitter:title', name: 'twitter:title', property: 'twitter:title', content: '瞬MATATAKI—发布瞬间,灵感永存' },
{ hid: 'twitter:image', name: 'twitter:image', property: 'twitter:image', content: 'https://ssimg.frontenduse.top/avatar/2019/08/30/c1d6ae7ed4e6102cb45d0a8f656d5569.png' },
{ hid: 'twitter:description', name: 'description', property: 'twitter:description', content: '瞬MATATAKI是一个永久存储和版权确权的内容平台,通过IPFS协议保障内容的永久可访问和确权信息可查询。使用了通证经济来激励创作者、探索者、布道者共建未来的超级知识链接网络。' },
/* <!-- 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: '瞬MATATAKI—发布瞬间,灵感永存' },
{ hid: 'og:title', name: 'og:title', property: 'og:title', content: '瞬MATATAKI—发布瞬间,灵感永存' },
{ hid: 'og:image', name: 'og:image', property: 'og:image', content: 'https://ssimg.frontenduse.top/avatar/2019/08/30/c1d6ae7ed4e6102cb45d0a8f656d5569.png' },
{ hid: 'og:description', name: 'description', property: 'og:description', content: '瞬MATATAKI是一个永久存储和版权确权的内容平台,通过IPFS协议保障内容的永久可访问和确权信息可查询。使用了通证经济来激励创作者、探索者、布道者共建未来的超级知识链接网络。' },
{ hid: 'og:type', name: 'og:type', property: 'og:type', content: 'article' }
/* end */
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
],
script: [
{ src: '/html2canvas.min.js' },
{ src: '/qrcode.min.js' },
{ src: '/gt.js' }
]
},
/*
** Customize the progress-bar color
*/
loading: {
color: '#542DE0'
},
/*
** Global CSS
*/
css: [
'normalize.css',
'element-ui/lib/theme-chalk/index.css',
'./assets/css/index.less'
],
/*
** Plugins to load before mounting the App
*/
plugins: [
'~/plugins/axios',
'~/plugins/combined-inject.js',
// '~/plugins/element-ui',
'~/plugins/vue_plugins.js',
'~/plugins/vue_components.js',
{ src: '@/plugins/element-ui', ssr: true },
{ src: '@/plugins/vue-mavon-editor', ssr: false },
{ src: '~/plugins/vue_scroll_reveal.js', ssr: false }
],
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://axios.nuxtjs.org/usage
'@nuxtjs/axios',
'@nuxtjs/eslint-module',
'@nuxtjs/style-resources',
'@nuxtjs/pwa'
],
styleResources: {
less: './assets/css/global.less'
},
/*
** Axios module configuration
** See https://axios.nuxtjs.org/options
*/
axios: {
},
/*
** Build configuration
*/
build: {
/*
** You can extend webpack config here
*/
extend(config, { isDev, isClient }) {
if (isDev) {
config.devtool = isClient ? 'source-map' : 'inline-source-map'
}
// set svg-sprite-loader
if (isClient) {
config.module.rules.forEach((rule) => {
if (~rule.test.source.indexOf('|svg')) {
rule.exclude = [resolve('icons/svg')]
}
})
config.module.rules.push({
test: /\.svg$/,
loader: 'svg-sprite-loader',
include: [resolve('icons/svg')], // include => 只处理指定的文件夹下的文件
options: {
symbolId: 'icon-[name]'
}
})
// console.log(config.module.rules)
// set svg-sprite-loader end
}
},
plugins: [
new SpriteLoaderPlugin(), // set svg-sprite-loader
new webpack.ContextReplacementPlugin(
/moment[/\\]locale$/,
/zh-cn/
)
// new BundleAnalyzerPlugin()
]
},
server: {
port: 8080, // default: 3000
host: '0.0.0.0'
},
env: genENV()
}