-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathnuxt.config.ts
164 lines (142 loc) · 4.16 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
import type { NuxtConfig } from '@nuxt/types';
import locales from './locales';
import sites from './data/sites.json';
import { Data } from './types';
const nuxtConfig: NuxtConfig = {
generate: {
fallback: '404.html',
},
router: {
trailingSlash: true,
},
publicRuntimeConfig: {
siteTitle: process.env.SITE_TITLE,
siteUrl: process.env.SITE_URL,
siteReportUrl: process.env.SITE_REPORT_URL,
sourceCodeUrl: process.env.SOURCE_CODE_URL,
siteDescriptionEn: process.env.SITE_DESCRIPTION_EN,
siteDescriptionJp: process.env.SITE_DESCRIPTION_JP,
indexAccessCounterUrl: process.env.INDEX_ACCESS_COUNTER_URL,
},
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
},
// Global CSS: https://go.nuxtjs.dev/config-css
css: [
'~/assets/styles/global.scss',
],
// Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
plugins: [
'~/plugins/i18n-vuetify.client.ts',
],
// Auto import components: https://go.nuxtjs.dev/config-components
components: false,
// Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
buildModules: [
// https://go.nuxtjs.dev/typescript
'@nuxt/typescript-build',
// https://go.nuxtjs.dev/stylelint
'@nuxtjs/stylelint-module',
// https://go.nuxtjs.dev/vuetify
'@nuxtjs/vuetify',
// https://composition-api.nuxtjs.org/
'@nuxtjs/composition-api/module',
// https://pinia.vuejs.org/ssr/nuxt.html
'@pinia/nuxt',
],
// Modules: https://go.nuxtjs.dev/config-modules
modules: [
// https://go.nuxtjs.dev/axios
'@nuxtjs/axios',
// https://go.nuxtjs.dev/pwa
'@nuxtjs/pwa',
// https://go.nuxtjs.dev/content
'@nuxt/content',
// https://i18n.nuxtjs.org/
'@nuxtjs/i18n',
// https://sitemap.nuxtjs.org/
'@nuxtjs/sitemap',
// https://github.com/nuxt-community/google-gtag-module
'@nuxtjs/google-gtag',
// https://sentry.nuxtjs.org/
'@nuxtjs/sentry',
],
i18n: {
baseUrl: process.env.SITE_URL,
langDir: '~/locales/',
locales,
defaultLocale: 'en',
strategy: 'no_prefix',
lazy: true,
vueI18n: {
fallbackLocale: 'en',
},
},
sitemap: {
hostname: process.env.SITE_URL,
path: '/sitemap.xml',
sitemaps: sites.filter((site) => !site.isHidden).map((site) => ({
path: `/sitemap-${site.gameCode}.xml`,
async routes() {
const response = await fetch(`${site.dataSourceUrl}/data.json`);
const data = await response.json() as Data;
return [
`/${site.gameCode}/`,
`/${site.gameCode}/gallery/`,
`/${site.gameCode}/songs/`,
`/${site.gameCode}/about/`,
...data.songs.map((song) => `/${site.gameCode}/song/?id=${encodeURIComponent(song.songId!)}`),
];
},
})),
},
'google-gtag': {
id: process.env.GTAG_TRACK_ID,
debug: process.env.NODE_ENV === 'development',
},
sentry: {
dsn: process.env.SENTRY_DSN,
// Additional Module Options go here
// https://sentry.nuxtjs.org/sentry/options
config: {
// Add native Sentry config here
// https://docs.sentry.io/platforms/javascript/guides/vue/configuration/options/
},
},
// Axios module configuration: https://go.nuxtjs.dev/config-axios
axios: {
// Workaround to avoid enforcing hard-coded localhost:3000: https://github.com/nuxt-community/axios-module/issues/308
baseURL: '/',
},
// PWA module configuration: https://go.nuxtjs.dev/pwa
pwa: {
manifest: {
lang: 'en',
},
},
// Content module configuration: https://go.nuxtjs.dev/config-content
content: {},
// Vuetify module configuration: https://go.nuxtjs.dev/config-vuetify
vuetify: {
customVariables: ['~/assets/styles/variables.scss'],
optionsPath: '~/vuetify.options.ts',
},
// Build Configuration: https://go.nuxtjs.dev/config-build
build: {
transpile: [
'vuetify/src/locale',
'vue-echarts',
'echarts',
'zrender',
'yaml',
],
extend(config) {
config.module?.rules.push({
test: /\.ya?ml$/,
type: 'javascript/auto',
use: 'yaml-loader',
});
},
},
};
export default nuxtConfig;