TOPVERSE_Official/nuxt.config.ts

165 lines
4.0 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-06-01 15:36:34 +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',
2024-05-25 14:47:39 +08:00
'@unocss/nuxt',
'@nuxtjs/i18n',
2023-04-23 23:14:52 +08:00
'@vue-macros/nuxt',
2023-05-04 17:42:22 +08:00
'@nuxt/content',
2024-05-25 14:47:39 +08:00
'@nuxtjs/color-mode',
2023-04-23 23:14:52 +08:00
'@nuxt/devtools',
2023-04-23 14:19:03 +08:00
],
2023-06-01 15:36:34 +08:00
2023-06-01 01:03:02 +08:00
// content: {
// experimental: {
// clientDB: true
// }
// },
2024-05-25 11:30:47 +08:00
// image: {
// // provider:"static"
// },
2023-05-30 21:13:48 +08:00
// optimizedImages: {
// optimizeImages: true
// },
2024-05-25 11:30:47 +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' },
2023-06-19 19:37:06 +08:00
{
name: 'baidu-site-verification',
content: 'codeva-Kp2zJogRLy',
},
{
name: 'baidu-site-verification',
content: 'codeva-SHLbtRS3fs',
},
2023-07-01 19:24:39 +08:00
{
name: 'baidu-site-verification',
content: 'codeva-lpuY2ux6I7',
},
2023-06-19 19:42:58 +08:00
{
name: 'msvalidate.01',
content: '65342CA07E5F201B3D48569C2E706FDA',
},
2023-04-23 14:19:03 +08:00
],
2023-06-19 20:23:24 +08:00
// script: [{
// innerHTML: `
// (function(c,l,a,r,i,t,y){
// c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
// t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
// y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
// })(window, document, "clarity", "script", "hmbju0mzmd");
// `,
// type: 'text/javascript',
// }],
2023-04-23 14:19:03 +08:00
},
},
2024-05-25 14:39:34 +08:00
// pwa,
2023-04-23 14:19:03 +08:00
devtools: {
enabled: true,
},
2023-04-27 13:58:47 +08:00
telemetry: false,
2023-04-23 14:19:03 +08:00
})