-
Notifications
You must be signed in to change notification settings - Fork 1
/
nuxt.config.ts
46 lines (43 loc) · 1.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
import config from './config.json';
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
devtools: { enabled: true },
css: ['~/assets/css/main.css'],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
plugins: [
{ src: '~/plugins/matomo.js', mode: 'client' }
],
devServer: {
port: 10000
},
modules: [
'@nuxtjs/i18n'
],
i18n: {
vueI18n: './i18n.config.ts', // if you are using custom path, default
locales: ['de', 'en'], // used in URL path prefix
defaultLocale: 'de', // default locale of your project for Nuxt pages and routings
},
hooks: {
// We need this to add the dynamic routes to the static website!
// We have to generate all possible language pathes...
// https://dev.to/rafaelmagalhaes/generating-dynamic-routes-for-static-site-generation-with-nuxt-3-1epi
async 'nitro:config'(nitroConfig) {
let slugs = [];
for (const task of config.tasks) {
if(task.slug) {
for (const language in task.slug) {
slugs.push((language=='de'?'':'/'+language)+'/list/' + task.slug[language]);
}
}
}
// add the routes to the nitro config
nitroConfig.prerender.routes.push(...slugs);
},
},
})