TOPVERSE_Official/nuxt.config.ts

133 lines
3.1 KiB
TypeScript
Raw Normal View History

2023-04-23 23:14:52 +08:00
import { colors } from 'unocss/preset-mini'
2023-04-23 14:19:03 +08:00
import { pwa } from './config/pwa'
import { appDescription } from './constants/index'
2023-04-23 23:14:52 +08:00
import { hex2hsl } from './utils/colors'
2023-04-23 14:19:03 +08:00
export default defineNuxtConfig({
2023-05-30 00:33:57 +08:00
// ssr:false,
2023-04-23 14:19:03 +08:00
modules: [
'@vueuse/nuxt',
2023-04-23 23:14:52 +08:00
'@anu-vue/nuxt',
2023-04-23 14:19:03 +08:00
'@unocss/nuxt',
'@pinia/nuxt',
2023-04-23 23:14:52 +08:00
'@nuxtjs/i18n',
// '@nuxtjs/strapi',
'@vue-macros/nuxt',
2023-05-04 17:42:22 +08:00
'@nuxt/content',
2023-04-23 14:19:03 +08:00
'@nuxtjs/color-mode',
'@vite-pwa/nuxt',
2023-05-30 15:58:04 +08:00
'@aceforth/nuxt-optimized-images',
2023-04-23 23:14:52 +08:00
'@nuxt/devtools',
2023-04-23 14:19:03 +08:00
],
2023-05-30 15:58:04 +08:00
optimizedImages: {
optimizeImages: true
},
2023-04-23 14:19:03 +08:00
experimental: {
// when using generate, payload js assets included in sw precache manifest
// but missing on offline, disabling extraction it until fixed
payloadExtraction: false,
inlineSSRStyles: false,
renderJsonPayloads: true,
},
2023-05-26 19:53:05 +08:00
components: [{
path: '~/components',
global: true,
}],
2023-04-23 23:14:52 +08:00
anu: {
// initialTheme: 'dark',
themes: {
// @ts-expect-error
light: {
colors: {
primary: hex2hsl(colors.indigo[500]).toString(),
success: hex2hsl(colors.green[500]).toString(),
warning: hex2hsl(colors.amber[500]).toString(),
danger: hex2hsl(colors.rose[500]).toString(),
info: hex2hsl(colors.blue[500]).toString(),
},
2023-05-16 21:18:46 +08:00
cssVars: {
// 'base-c': hex2hsl(colors.white).toString(),
'body-bg-c': hex2hsl(colors.white).toString(),
},
2023-04-23 23:14:52 +08:00
},
// @ts-expect-error
dark: {
colors: {
primary: hex2hsl(colors.indigo[500]).toString(),
success: hex2hsl(colors.green[500]).toString(),
warning: hex2hsl(colors.amber[500]).toString(),
danger: hex2hsl(colors.rose[500]).toString(),
info: hex2hsl(colors.blue[500]).toString(),
},
2023-05-16 21:18:46 +08:00
cssVars: {
'body-bg-c': hex2hsl(colors.dark[900]).toString(),
},
2023-04-23 23:14:52 +08:00
},
},
},
2023-04-23 14:19:03 +08:00
css: [
2023-04-23 23:14:52 +08:00
// '@unocss/reset/tailwind.css',
'anu-vue/dist/style.css',
'@anu-vue/preset-theme-default/dist/style.css',
'~/styles/ui.css',
2023-04-23 14:19:03 +08:00
],
2023-04-23 23:14:52 +08:00
i18n: {
locales: [
{
code: 'en',
2023-04-26 21:33:19 +08:00
file: 'en-UK.json',
2023-04-23 23:14:52 +08:00
},
{
code: 'zh',
file: 'zh-CN.json',
},
],
lazy: true,
langDir: 'locales',
defaultLocale: 'zh',
},
2023-04-23 14:19:03 +08:00
colorMode: {
classSuffix: '',
},
2023-04-23 23:14:52 +08:00
// strapi: {
// devtools: true,
// },
2023-04-23 14:19:03 +08:00
nitro: {
esbuild: {
options: {
target: 'esnext',
},
},
prerender: {
crawlLinks: false,
routes: ['/'],
ignore: ['/hi'],
},
},
app: {
head: {
viewport: 'width=device-width,initial-scale=1',
link: [
{ rel: 'icon', href: '/favicon.ico', sizes: 'any' },
2023-04-23 23:14:52 +08:00
{ rel: 'icon', type: 'image/svg+xml', href: '/topverse.icon.svg' },
2023-04-23 14:19:03 +08:00
{ rel: 'apple-touch-icon', href: '/apple-touch-icon.png' },
],
meta: [
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'description', content: appDescription },
{ name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' },
],
},
},
pwa,
devtools: {
enabled: true,
},
2023-04-27 13:58:47 +08:00
telemetry: false,
2023-04-23 14:19:03 +08:00
})