forked from vuejs-jp/vuefes-2019
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.ts
153 lines (149 loc) · 4.33 KB
/
nuxt.config.ts
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
import NuxtConfiguration from '@nuxt/config'
import StylelintPlugin from 'stylelint-webpack-plugin'
import hooks from './src/hooks'
import speakers from './test/fixtures/contentful/speakers'
require('dotenv').config()
const defaultUrl = 'https://vuefes.jp/2019/'
const defaultTitle = 'Vue Fes Japan 2019'
const defaultDescription =
'2019年10月12日(土)に開催される日本最大級の Vue.js カンファレンス。国内外の著名スピーカーによるセッションの他、ユーザー同士が気軽に話し合える場も設ける予定です。ぜひ、一緒に Vue.js を楽しみ、盛り上げていきましょう!'
const defaultOgImageUrl = 'https://vuefes.jp/2019/opengraph.png'
const applicationName = 'Vue Fes' // 「ホーム画面に追加」したときのアプリケーション名
const config: NuxtConfiguration = {
mode: 'universal',
srcDir: 'src/',
router: {
base: '/2019/'
},
hooks: hooks(this),
head: {
htmlAttrs: {
lang: 'ja'
},
title: defaultTitle,
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'og:locale', content: 'ja_JP' },
{ name: 'og:type', content: 'website' },
{ name: 'og:site_name', content: 'Vue Fes Japan 2019' },
{ name: 'twitter:creator', content: '@vuefes' },
{ hid: 'description', name: 'description', content: defaultDescription },
{ hid: 'og:url', name: 'og:url', content: defaultUrl },
{ hid: 'og:title', name: 'og:title', content: defaultTitle },
{
hid: 'og:description',
name: 'og:description',
content: defaultDescription
},
{ hid: 'og:image', name: 'og:image', content: defaultOgImageUrl },
{
hid: 'og:image:secure_url',
name: 'og:image:secure_url',
content: defaultOgImageUrl
},
{
hid: 'twitter:card',
name: 'twitter:card',
content: 'summary_large_image'
},
{ hid: 'twitter:title', name: 'twitter:title', content: defaultTitle },
{
hid: 'twitter:description',
name: 'twitter:description',
content: defaultDescription
},
{
hid: 'twitter:image',
name: 'twitter:image',
content: defaultOgImageUrl
},
{
name: 'application-name',
content: applicationName
},
{
name: 'apple-mobile-web-app-title',
content: applicationName
}
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/2019/favicon.ico' },
{
rel: 'apple-touch-icon',
href: '/2019/apple-touch-icon.png',
sizes: '180x180'
}
]
},
loading: { color: '#fff' },
css: ['~/assets/stylesheets/main.scss'],
plugins: [
{ src: '~/plugins/typekit', mode: 'client' },
{ src: '~/plugins/vee-validate' },
{ src: '~/plugins/vue-lazyload', mode: 'client' },
{ src: '~/plugins/scroll-anchor-links', mode: 'client' }
],
modules: [
'@nuxtjs/dotenv',
[
'nuxt-fontawesome',
{
component: 'fa'
}
],
[
'@nuxtjs/google-analytics',
{
id: process.env.GA_TRACKING_ID || 'UA-XXXXXXX-X'
}
],
'@nuxtjs/style-resources',
[
'@nuxtjs/pwa',
{
icon: {
iconSrc: 'src/static/apple-touch-icon.png'
}
}
]
],
env: {
CTF_SPACE_ID: process.env.CTF_SPACE_ID || 'PLEASE_SET_CTF_SPACE_ID',
CTF_CDA_ACCESS_TOKEN:
process.env.CTF_CDA_ACCESS_TOKEN || 'PLEASE_SET_CTF_CDA_ACCESS_TOKEN',
GOOGLE_MAPS_API_KEY: process.env.GOOGLE_MAPS_API_KEY || 'PLEASE_SET_ME'
},
build: {
extend(config, ctx) {
if (ctx.isDev && ctx.isClient) {
config.module!.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
config.plugins!.push(
new StylelintPlugin({
files: ['**/*.vue', '**/*.scss']
})
)
}
}
},
generate: {
dir: 'dist/2019',
routes: speakers.map(speaker => `/sessions/${speaker.fields.github}`)
},
styleResources: {
scss: [
'~/assets/stylesheets/foundation/variables.scss',
'~/assets/stylesheets/foundation/colors.scss'
]
},
manifest: {
short_name: 'Vue Fes',
name: 'Vue Fes'
}
}
export default config