This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
nuxt.config.ts
216 lines (214 loc) · 5.9 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
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
import { NuxtConfig } from '@nuxt/types'
import i18n from './nuxt-i18n.config'
const webpack = require('webpack')
const purgecss = require('@fullhuman/postcss-purgecss')
const autoprefixer = require('autoprefixer')
const environment = process.env.NODE_ENV || 'development'
const config: NuxtConfig = {
mode: 'universal',
target: 'static',
/*
** Headers of the page
*/
head: {
htmlAttrs: {
prefix: 'og: http://ogp.me/ns#',
},
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ hid: 'og:type', property: 'og:type', content: 'website' },
{
hid: 'og:url',
property: 'og:url',
content: 'https://kyoto.stopcovid19.jp',
},
{
hid: 'twitter:card',
name: 'twitter:card',
content: 'summary_large_image',
},
{
hid: 'twitter:site',
name: 'twitter:site',
content: '@covid19_kyoto',
},
{
hid: 'twitter:creator',
name: 'twitter:creator',
content: '@covid19_kyoto',
},
{
hid: 'fb:app_id',
property: 'fb:app_id',
content: '2879625188795443',
},
{
hid: 'note:card',
property: 'note:card',
content: 'summary_large_image',
},
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
{ rel: 'apple-touch-icon', href: '/apple-touch-icon-precomposed.png' },
{
rel: 'stylesheet',
href: 'https://use.fontawesome.com/releases/v5.6.1/css/all.css',
},
],
},
/*
** Customize the progress-bar color
*/
loading: { color: '#fff' },
/*
** Global CSS
*/
css: ['~assets/global.scss'],
/*
** Plugins to load before mounting the App
*/
plugins: [
{
src: '@/plugins/vue-chart.ts',
ssr: true,
},
{
src: '@/plugins/axe',
ssr: true,
},
{
src: '@/plugins/vuetify.ts',
ssr: true,
},
],
/*
** Nuxt.js dev-modules
*/
buildModules: [
'@nuxtjs/stylelint-module',
'@nuxtjs/vuetify',
'@nuxt/typescript-build',
'@nuxtjs/google-analytics',
],
/*
** Nuxt.js modules
*/
modules: [
'@nuxtjs/pwa',
// Doc: https://github.com/nuxt-community/dotenv-module
['@nuxtjs/dotenv', { filename: `.env.${environment}` }],
['nuxt-i18n', i18n],
'nuxt-svg-loader',
'nuxt-purgecss',
['vue-scrollto/nuxt', { duration: 1000, offset: -72 }],
],
/*
** vuetify module configuration
** https://github.com/nuxt-community/vuetify-module
*/
vuetify: {
customVariables: ['~/assets/variables.scss'],
treeShake: true,
defaultAssets: {
icons: false,
},
},
googleAnalytics: {
id: process.env.GOOGLE_ANALYTICS_ID, // .env.production などに設定してください。
},
/*
* nuxt-i18n による自動リダイレクトを停止したためコメントアウト
* @todo 「Cookieがあるときのみ、その言語にリダイレクトする」を実装する場合は復活させる
* 実装しない場合は以下の記述を完全に削除する
*/
/* optionalCookies: [
{
name: 'i18n_redirected',
label: 'i18n Redirection Cookie',
description:
'For automatically switching UI languages in accordance with locale preferences in the web browser configuration.',
cookies: ['i18n_redirected']
}
], */
build: {
plugins: [
new webpack.ProvidePlugin({
mapboxgl: 'mapbox-gl',
}),
],
postcss: {
plugins: [
autoprefixer({ grid: 'autoplace' }),
purgecss({
content: [
'./pages/**/*.vue',
'./layouts/**/*.vue',
'./components/**/*.vue',
'./node_modules/vuetify/dist/vuetify.js',
'./node_modules/vue-spinner/src/ScaleLoader.vue',
],
whitelist: ['html', 'body', 'nuxt-progress', 'DataCard'],
whitelistPatterns: [/(col|row)/],
}),
],
},
extend(config) {
// default externals option is undefined
config.externals = [{ moment: 'moment' }]
},
// https://ja.nuxtjs.org/api/configuration-build/#hardsource
// hardSource: process.env.NODE_ENV === 'development'
},
manifest: {
name: '京都府 新型コロナウイルス感染症対策サイト',
theme_color: '#85005d',
background_color: '#ffffff',
display: 'standalone',
Scope: '/',
start_url: '/',
splash_pages: null,
},
generate: {
fallback: true,
/* routes() {
const locales = ['en', 'zh-cn', 'zh-tw', 'ko', 'ja-basic']
const pages = [
'/cards/details-of-confirmed-cases',
'/cards/number-of-confirmed-cases',
'/cards/number-of-confirmed-cases-by-municipalities',
'/cards/attributes-of-confirmed-cases',
'/cards/number-of-tested',
'/cards/number-of-reports-to-covid19-telephone-advisory-center',
'/cards/predicted-number-of-toei-subway-passengers',
'/cards/agency',
'/cards/positive-rate',
'/cards/positive-number-by-diagnosed-date',
'/cards/monitoring-number-of-confirmed-cases',
'/cards/untracked-rate',
'/cards/positive-status-severe-case',
'/cards/number-of-hospitalized',
'/cards/monitoring-number-of-reports-to-covid19-consultation-desk',
'/cards/monitoring-status-overview',
'/cards/number-of-reports-to-consultations-about-fever-in-7119',
'/cards/number-of-tokyo-rules-applied',
'/cards/monitoring-items-overview',
'/cards/positive-number-by-developed-date',
]
const localizedPages = locales
.map((locale) => pages.map((page) => `/${locale}${page}`))
.reduce((a, b) => [...a, ...b], [])
return [...pages, ...localizedPages]
}, */
},
// /*
// ** hot read configuration for docker
// */
watchers: {
webpack: {
poll: true,
},
},
}
export default config