-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnuxt.config.ts
103 lines (101 loc) · 2.27 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
import { globSync } from 'glob'
import vuetify from 'vite-plugin-vuetify'
const getContentRoutes = (): string[] => {
const routeNames = globSync('src/content/**/*.md').map((f) =>
f.replaceAll('\\', '/').replaceAll('src/content', '').replace('.md', '')
)
const extraRoutes = [
'/ja/maintenance',
'/ja/update',
'/ja/information',
'/en/maintenance',
'/en/update',
'/en/information'
]
return [...routeNames, ...extraRoutes]
}
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
srcDir: 'src/',
ssr: true,
css: ['@/styles/main.scss'],
build: {
transpile: ['vuetify']
},
nitro: {
prerender: {
routes: getContentRoutes()
}
},
image: {
quality: 80,
format: ['webp']
},
content: {
markdown: {
remarkPlugins: ['remark-breaks']
}
},
modules: [
'@nuxtjs/google-fonts',
'@nuxt/content',
'@nuxtjs/i18n',
'@nuxt/image',
(_, nuxt) => {
nuxt.hooks.hook('vite:extendConfig', (config) => {
if (!config.plugins) {
return
}
config.plugins.push(vuetify({ autoImport: true }))
})
}
],
googleFonts: {
families: {
Lato: [400]
},
display: 'swap'
},
i18n: {
strategy: 'prefix',
defaultLocale: 'en',
locales: [
{ code: 'en', iso: 'en-US' },
{ code: 'ja', iso: 'ja-JP' }
],
vueI18n: './i18n.config.ts'
},
typescript: {
shim: false,
strict: true,
tsConfig: {
compilerOptions: {
strict: true,
noImplicitReturns: true,
noFallthroughCasesInSwitch: true
}
}
},
devtools: { enabled: true },
app: {
baseURL: import.meta.env.GITHUB_ACTIONS ? '/recreate-news/' : undefined,
cdnURL: import.meta.env.GITHUB_ACTIONS
? 'https://dosugamea.github.io/recreate-news/'
: undefined,
buildAssetsDir: 'assets',
head: {
title: 'Sparkle News',
titleTemplate: '%s - Sparkle News',
viewport: 'width=device-width, initial-scale=1, maximum-scale=5',
charset: 'utf-8',
link: [
{
rel: 'icon',
type: 'image/png',
href: '/recreate-news/assets/hitode.png'
}
],
meta: [{ name: 'robots', content: 'noindex,nofollow,noarchive' }]
}
}
})