Fixes: 1) Replace deprecated context usage in `useAvatarUpload` mutation; 2) Resolve incorrect locale parsing in `useDate` utility and fix non-reactive cart state in `profile/cart.vue`; 3) Update stale imports and standardize type naming across composables; Extra: 1) Refactor i18n strings including order status and search-related texts; 2) Replace temporary workarounds with `apollo-upload-client` configuration and add `apollo-upload-link.ts` plugin; 3) Cleanup redundant files, comments, and improve SCSS structure with new variables and placeholders.
112 lines
No EOL
3 KiB
TypeScript
112 lines
No EOL
3 KiB
TypeScript
import { defineNuxtConfig } from 'nuxt/config';
|
|
import { i18nConfig } from './config/i18n';
|
|
import {fileURLToPath, URL} from "node:url";
|
|
import { resolve } from 'node:path';
|
|
import createUploadLink from "apollo-upload-client/createUploadLink.mjs";
|
|
|
|
export default defineNuxtConfig({
|
|
ssr: true,
|
|
devtools: { enabled: true },
|
|
typescript: { strict: true },
|
|
modules: [
|
|
"@nuxtjs/i18n",
|
|
"@nuxt/icon",
|
|
"@pinia/nuxt",
|
|
"@nuxtjs/apollo",
|
|
"@vueuse/nuxt",
|
|
"@element-plus/nuxt",
|
|
"nuxt-marquee",
|
|
"@nuxt/image"
|
|
],
|
|
i18n: i18nConfig,
|
|
apollo: {
|
|
autoImports: true,
|
|
clients: {
|
|
default: {
|
|
httpEndpoint: `https://api.${process.env.EVIBES_BASE_DOMAIN}/graphql/`,
|
|
connectToDevTools: true,
|
|
authType: 'Bearer',
|
|
authHeader: 'X-EVIBES-AUTH',
|
|
tokenStorage: 'cookie',
|
|
tokenName: `${process.env.EVIBES_PROJECT_NAME?.toLowerCase()}-access`,
|
|
}
|
|
}
|
|
},
|
|
runtimeConfig: {
|
|
public: {
|
|
evibesProjectName: process.env.EVIBES_PROJECT_NAME,
|
|
evibesBaseDomain: process.env.EVIBES_BASE_DOMAIN
|
|
},
|
|
},
|
|
app: {
|
|
head: {
|
|
charset: "utf-8",
|
|
viewport: "width=device-width, initial-scale=1",
|
|
title: process.env.EVIBES_PROJECT_NAME,
|
|
titleTemplate: `${process.env.EVIBES_PROJECT_NAME} | %s`,
|
|
link: [
|
|
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
|
|
]
|
|
},
|
|
pageTransition: {
|
|
name: 'opacity',
|
|
mode: 'out-in'
|
|
}
|
|
},
|
|
css: [
|
|
'./assets/styles/main.scss',
|
|
'./assets/styles/global/fonts.scss'
|
|
],
|
|
alias: {
|
|
'styles': fileURLToPath(new URL("./assets/styles", import.meta.url)),
|
|
'images': fileURLToPath(new URL("./assets/images", import.meta.url)),
|
|
'icons': fileURLToPath(new URL("./assets/icons", import.meta.url)),
|
|
},
|
|
vite: {
|
|
envDir: '../',
|
|
envPrefix: 'EVIBES_',
|
|
css: {
|
|
preprocessorOptions: {
|
|
scss: {
|
|
additionalData: `
|
|
@use "@/assets/styles/global/variables.scss" as *;
|
|
@use "@/assets/styles/global/mixins.scss" as *;
|
|
`
|
|
}
|
|
}
|
|
}
|
|
},
|
|
image: {
|
|
domains: [`https://api.${process.env.EVIBES_BASE_DOMAIN}`]
|
|
},
|
|
hooks: {
|
|
'pages:extend'(pages) {
|
|
pages.push(
|
|
{
|
|
name: 'activate-user',
|
|
path: '/activate-user',
|
|
file: resolve(__dirname, 'pages/index.vue')
|
|
},
|
|
{
|
|
name: 'reset-password',
|
|
path: '/reset-password',
|
|
file: resolve(__dirname, 'pages/index.vue')
|
|
}
|
|
)
|
|
},
|
|
// 'apollo:client:created'(apolloClient, { key }) {
|
|
// console.log(key)
|
|
// console.log('log')
|
|
// if ( key !== 'default' ) return
|
|
// const runtime = useRuntimeConfig()
|
|
// const uploadLink = createUploadLink({
|
|
// uri: `https://api.${runtime.public.evibesBaseDomain}/graphql/`,
|
|
// credentials: 'include',
|
|
// headers: {
|
|
// 'X-EVIBES-AUTH': useCookie(`${runtime.public.evibesProjectName?.toLowerCase()}-access`).value || ''
|
|
// }
|
|
// })
|
|
// apolloClient.setLink(uploadLink)
|
|
// }
|
|
}
|
|
}) |