jointrashposs/nuxt.config.ts

106 lines
2.2 KiB
TypeScript
Raw Normal View History

2023-07-08 10:36:02 +02:00
// https://nuxt.com/docs/api/configuration/nuxt-config
import ViteYaml from '@modyfi/vite-plugin-yaml';
import svgLoader from 'vite-svg-loader';
import genSitemap from './scripts/gen-sitemap';
2023-07-11 19:19:32 +02:00
import { resolve } from 'path';
2023-07-08 10:36:02 +02:00
2023-07-10 19:54:13 +02:00
// 公開時のドメイン(末尾スラッシュなし)
const baseUrl = 'https://misskey-hub.net';
2023-07-11 19:19:32 +02:00
const locales = [
{ code: 'ja', iso: 'ja-JP', name: '日本語' },
{ code: 'en', iso: 'en-US', name: 'English' },
{ code: 'ko', iso: 'ko-KR', name: '한국어' },
{ code: 'it', iso: 'it-IT', name: 'Italiano' },
{ code: 'pl', iso: 'pl-PL', name: 'Polski' },
{ code: 'fr', iso: 'fr-FR', name: 'Français' },
];
2023-07-08 10:36:02 +02:00
export default defineNuxtConfig({
2023-07-10 19:54:13 +02:00
runtimeConfig: {
public: {
baseUrl,
}
},
2023-07-08 10:36:02 +02:00
css: [
2023-07-10 19:54:13 +02:00
"github-markdown-css/github-markdown.css",
2023-07-08 10:36:02 +02:00
"@/assets/css/tailwind.css",
2023-07-09 11:58:53 +02:00
"@/assets/css/bootstrap-forms.scss",
2023-07-08 10:36:02 +02:00
],
modules: [
'@nuxt/content',
'@nuxtjs/i18n',
2023-07-08 19:23:27 +02:00
'@nuxtjs/color-mode',
2023-07-08 10:36:02 +02:00
],
app: {
head: {
link: [
{ rel: 'preconnect', href: 'https://fonts.googleapis.com' },
{ rel: 'preconnect', href: 'https://fonts.gstatic.com' },
2023-07-08 19:23:27 +02:00
{ rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Capriola&family=Nunito:ital,wght@0,400;0,700;1,400;1,700&display=swap' },
2023-07-08 10:36:02 +02:00
{ rel: 'stylesheet', href: '/fonts/fonts.css' },
],
},
},
2023-07-10 19:54:13 +02:00
content: {
2023-07-11 19:19:32 +02:00
//sources: Object.fromEntries(locales.map((e) => [e.code, { driver: 'fs', prefix: `/${e.code}`, base: resolve(__dirname, `content/${e.iso}`), }])),
2023-07-10 19:54:13 +02:00
navigation: {
fields: [
'date',
]
}
},
2023-07-08 10:36:02 +02:00
i18n: {
2023-07-10 19:54:13 +02:00
baseUrl,
2023-07-08 10:36:02 +02:00
vueI18n: './i18n.config.ts',
2023-07-11 19:19:32 +02:00
locales,
2023-07-08 10:36:02 +02:00
defaultLocale: 'ja',
strategy: 'prefix',
},
2023-07-08 19:23:27 +02:00
colorMode: {
classSuffix: '',
},
2023-07-08 10:36:02 +02:00
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
alias: {
'bi': 'bootstrap-icons/icons',
},
vite: {
plugins: [
ViteYaml(),
svgLoader({
defaultImport: 'component',
svgoConfig: {
plugins: [
{
name: 'preset-default',
params: {
overrides: {
removeViewBox: false,
}
}
}
]
}
}),
]
},
nitro: {
hooks: {
'compiled': genSitemap,
},
prerender: {
routes: [
"/404.html"
]
},
plugins: [
'@/server/plugins/appendComment.ts',
],
}
})