-
Notifications
You must be signed in to change notification settings - Fork 22
/
nuxt.config.ts
110 lines (96 loc) · 2.54 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
import { resolve } from 'path'
// Need to explicitly import this otherwise vite.config yells at us
import { defineNuxtConfig } from 'nuxt/config'
import Icons from 'unplugin-icons/vite'
import { FileSystemIconLoader } from 'unplugin-icons/loaders'
import IconResolver from 'unplugin-icons/resolver'
import Components from 'unplugin-vue-components/vite'
import { supportedLocales } from './configUtils'
import type { ViteConfig } from 'nuxt/schema'
// https://v3.nuxtjs.org/api/configuration/nuxt.config
const nuxtAliases = {
blocks: resolve(__dirname, './components/blocks'),
composables: resolve(__dirname, './composables'),
elements: resolve(__dirname, './components/elements'),
layouts: resolve(__dirname, './layouts'),
lib: resolve(__dirname, './lib'),
pages: resolve(__dirname, './pages'),
root: resolve(__dirname, './'),
}
// Used in Vitest
export const viteConfig: ViteConfig = {
plugins: [
Icons({
autoInstall: true,
compiler: 'vue3',
customCollections: {
svg: FileSystemIconLoader('./assets/sprite/svg'),
},
}),
Components({
dts: true,
resolvers: [
IconResolver({
customCollections: ['svg'],
}),
],
}),
],
resolve: {
alias: nuxtAliases,
},
}
export default defineNuxtConfig({
alias: nuxtAliases,
app: {
// Global page headers: https://v3.nuxtjs.org/api/configuration/nuxt.config#head
head: {
link: [
{
href: '/favicon.ico',
rel: 'icon',
type: 'image/x-icon',
},
],
meta: [
{ charset: 'utf-8' },
{ content: 'width=device-width, initial-scale=1', name: 'viewport' },
{ content: '', hid: 'description', name: 'description' },
{ content: 'telephone=no', name: 'format-detection' },
],
title: 'leaderboards.gg',
},
},
devServerHandlers: [],
i18n: {
defaultLocale: 'en',
locales: supportedLocales,
vueI18n: './i18n.config.ts',
},
ignore: ['**/*.test.ts', '**/node_modules', '.output', '.dist'],
imports: {
autoImport: false,
},
// Modules: https://v3.nuxtjs.org/api/configuration/nuxt.config#modules
modules: [
[
'@nuxtjs/tailwindcss',
{
configPath: 'tailwind.config.js',
cssPath: './assets/css/tailwind.css',
},
],
'unplugin-icons/nuxt',
'@nuxtjs/i18n',
'@nuxt/test-utils/module',
'@nuxt/eslint',
],
runtimeConfig: {
public: {
backendBaseUrl: '',
},
},
ssr: false,
vite: viteConfig,
compatibilityDate: '2024-08-17',
})