-
Notifications
You must be signed in to change notification settings - Fork 0
/
nuxt.config.js
188 lines (182 loc) · 5.09 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
// SyntaxError: Unexpected token import
// import * as speakers from 'src/store/speakers'
import fs from 'fs'
const StylelintPlugin = require('stylelint-webpack-plugin')
// ERROR (node:79384) DeprecationWarning: Tapable.plugin is deprecated. Use new API on .hooks instead の詳細を確認するため
process.traceDeprecation = true
try {
fs.statSync('.env')
require('dotenv').config()
} catch (error) {
if (error.code === 'ENOENT') {
console.log('.env file NOT FOUND') // eslint-disable-line no-console
} else {
throw error
}
}
const defaultUrl = 'https://vuefes.jp/2018/'
const defaultTitle = 'Vue Fes Japan 2018 | 2018年11月3日(土)'
const defaultDescription =
'日本で初めて開催する大規模 Vue.js カンファレンス。国内外の著名スピーカーによるセッションの他、ユーザー同士が気軽に話し合える場も設ける予定です。ぜひ、一緒に Vue.js を楽しみ、盛り上げていきましょう!'
const defaultOgImageUrl = 'https://vuefes.jp/2018/opengraph.jpg'
const applicationName = 'Vue Fes' // 「ホーム画面に追加」したときのアプリケーション名
export default {
mode: 'universal',
srcDir: 'src/',
/*
** Headers of the page
*/
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 2018' },
{ 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: '/2018/favicon.ico' },
{
rel: 'apple-touch-icon',
href: '/2018/apple-touch-icon.png',
sizes: '180x180'
}
]
},
/*
** Customize the progress bar color
*/
loading: { color: '#3B8070' },
/*
** Build configuration
*/
build: {
/*
** Run ESLint on save
*/
extend(config, { isDev, isClient }) {
if (isDev && isClient) {
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude: /(node_modules)/
})
config.plugins.push(
new StylelintPlugin({
files: ['**/*.vue', '**/*.scss']
})
)
}
config.module.rules.push({
test: /\.webp$/,
loader: 'url-loader',
options: {
limit: 1000,
name: 'img/[name].[hash:7].[ext]'
}
})
}
},
css: [{ src: '~/assets/stylesheets/main.scss', lang: 'scss' }],
router: {
base: '/2018/',
scrollBehavior: (to, from, savedPosition) => {
return { x: 0, y: 0 }
}
},
generate: {
dir: 'dist/2018',
// TODO: speakers.getters.speakerIds を使うやり方に書き換えたい
// routes: speakers.getters.speakerIds(speakers.state()).map(speakerId => `/speakers/${speakerId}`),
routes: [
'yyx990803',
'sdras',
'Atinux',
'eddyerburgh',
'znck',
'Akryum',
'ktsn',
'fukuiretu',
'takanorip',
'ts020',
'tsuchikazu'
].map(speakerId => `/speakers/${speakerId}`)
},
modules: [
'@nuxtjs/google-analytics',
'@nuxtjs/style-resources',
[
'@nuxtjs/pwa',
{
icon: {
iconSrc: 'src/static/apple-touch-icon.png'
}
}
]
],
plugins: [
{ src: '~/plugins/global-navigation-handler', ssr: false },
{ src: '~/plugins/typekit', ssr: false },
{ src: '~/plugins/vue-lazyload', ssr: false }
],
env: {
googleMapsApiKey: process.env.GOOGLE_MAPS_API_KEY || 'PLEASE_SET_ME'
},
'google-analytics': {
id: process.env.GA_TRACKING_ID || 'UA-XXXXXXX-X'
},
styleResources: {
scss: [
'~/assets/stylesheets/foundation/variables.scss',
'~/assets/stylesheets/foundation/colors.scss'
]
},
manifest: {
short_name: 'Vue Fes',
name: 'Vue Fes'
}
}