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({
|
|
|
|
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-04-23 14:19:03 +08:00
|
|
|
'@nuxtjs/color-mode',
|
|
|
|
'@vite-pwa/nuxt',
|
2023-04-23 23:14:52 +08:00
|
|
|
'@nuxt/devtools',
|
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-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(),
|
|
|
|
},
|
|
|
|
},
|
|
|
|
// @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-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',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
detectBrowserLanguage: {
|
|
|
|
useCookie: true,
|
|
|
|
cookieCrossOrigin: true,
|
|
|
|
},
|
|
|
|
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
|
|
|
})
|