chore: 优化ts配置,更新版本,types解决。

main
NoahLan 1 year ago
parent 2b97f0fe9d
commit ee84f695e9

@ -5,7 +5,7 @@
"scripts": { "scripts": {
"build": "vite build", "build": "vite build",
"build:ssg": "vite-ssg build", "build:ssg": "vite-ssg build",
"dev": "vite --port 3333 --open", "dev": "vite --port 3333",
"lint": "eslint .", "lint": "eslint .",
"preview": "vite preview", "preview": "vite preview",
"preview-https": "serve dist", "preview-https": "serve dist",
@ -18,65 +18,65 @@
"sizecheck": "npx vite-bundle-visualizer" "sizecheck": "npx vite-bundle-visualizer"
}, },
"dependencies": { "dependencies": {
"@unhead/vue": "^1.1.27", "@unhead/vue": "^1.7.4",
"@unocss/reset": "^0.52.2", "@unocss/reset": "^0.55.7",
"@vueuse/core": "^10.1.2", "@vueuse/core": "^10.4.1",
"@vueuse/head": "^1.1.26", "@vueuse/head": "^2.0.0",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",
"pinia": "^2.1.3", "pinia": "^2.1.6",
"vue": "^3.3.4", "vue": "^3.3.4",
"vue-demi": "^0.14.5", "vue-demi": "^0.14.6",
"vue-i18n": "^9.2.2", "vue-i18n": "^9.4.1",
"vue-router": "^4.2.1" "vue-router": "^4.2.4"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^0.39.3", "@antfu/eslint-config": "^0.43.0",
"@iconify-json/carbon": "^1.1.16", "@iconify-json/carbon": "^1.1.21",
"@intlify/unplugin-vue-i18n": "^0.10.0", "@intlify/unplugin-vue-i18n": "^1.2.0",
"@types/markdown-it-link-attributes": "^3.0.1", "@types/markdown-it-link-attributes": "^3.0.1",
"@types/nprogress": "^0.2.0", "@types/nprogress": "^0.2.0",
"@types/qs": "^6.9.7", "@types/qs": "^6.9.7",
"@unocss/eslint-config": "^0.52.2", "@unocss/eslint-config": "^0.55.7",
"@vitejs/plugin-vue": "^4.2.3", "@vitejs/plugin-vue": "^4.3.4",
"@vue-macros/reactivity-transform": "^0.3.9", "@vue-macros/reactivity-transform": "^0.3.9",
"@vue-macros/short-vmodel": "^1.2.8", "@vue-macros/short-vmodel": "^1.2.8",
"@vue-macros/volar": "^0.9.8", "@vue-macros/volar": "^0.14.3",
"@vue/test-utils": "^2.3.2", "@vue/test-utils": "^2.4.1",
"critters": "^0.0.16", "critters": "^0.0.20",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"cypress": "^12.12.0", "cypress": "^13.2.0",
"cypress-vite": "^1.4.0", "cypress-vite": "^1.4.2",
"eslint": "^8.41.0", "eslint": "^8.49.0",
"eslint-plugin-cypress": "^2.13.3", "eslint-plugin-cypress": "^2.15.1",
"https-localhost": "^4.7.1", "https-localhost": "^4.7.1",
"lint-staged": "^13.2.2", "lint-staged": "^14.0.1",
"markdown-it-link-attributes": "^4.0.1", "markdown-it-link-attributes": "^4.0.1",
"markdown-it-shiki": "^0.9.0", "markdown-it-shiki": "^0.9.0",
"naive-ui": "^2.34.4", "naive-ui": "^2.34.4",
"pnpm": "^8.5.1", "pnpm": "^8.7.6",
"shiki": "^0.14.2", "shiki": "^0.14.4",
"simple-git-hooks": "^2.8.1", "simple-git-hooks": "^2.9.0",
"taze": "^0.10.1", "taze": "^0.11.2",
"typescript": "^5.0.4", "typescript": "^5.2.2",
"unocss": "^0.52.2", "unocss": "^0.55.7",
"unplugin-auto-import": "^0.16.2", "unplugin-auto-import": "^0.16.6",
"unplugin-vue-components": "^0.24.1", "unplugin-vue-components": "^0.25.2",
"unplugin-vue-macros": "^2.1.7", "unplugin-vue-macros": "^2.5.1",
"vite": "^4.3.8", "unplugin-vue-markdown": "^0.24.3",
"vite-bundle-visualizer": "^0.7.0", "vite": "^4.4.9",
"vite-plugin-inspect": "^0.7.28", "vite-bundle-visualizer": "^0.10.0",
"vite-plugin-pages": "^0.30.1", "vite-plugin-inspect": "^0.7.38",
"vite-plugin-pwa": "^0.15.0", "vite-plugin-pages": "^0.31.0",
"vite-plugin-pwa": "^0.16.5",
"vite-plugin-vue-component-preview": "^1.1.6", "vite-plugin-vue-component-preview": "^1.1.6",
"vite-plugin-vue-devtools": "^0.0.16", "vite-plugin-vue-devtools": "^1.0.0-rc.4",
"vite-plugin-vue-layouts": "^0.8.0", "vite-plugin-vue-layouts": "^0.8.0",
"vite-plugin-vue-markdown": "^0.23.5", "vite-plugin-webfont-dl": "^3.7.6",
"vite-plugin-webfont-dl": "^3.7.4", "vite-ssg": "^0.23.2",
"vite-ssg": "^0.22.2",
"vite-ssg-sitemap": "^0.5.1", "vite-ssg-sitemap": "^0.5.1",
"vitest": "^0.31.1", "vitest": "^0.34.4",
"vue-request": "^2.0.1", "vue-request": "^2.0.3",
"vue-tsc": "^1.6.5" "vue-tsc": "^1.8.11"
}, },
"simple-git-hooks": { "simple-git-hooks": {
"pre-commit": "pnpm lint-staged" "pre-commit": "pnpm lint-staged"

File diff suppressed because it is too large Load Diff

@ -41,29 +41,14 @@ const themeOverrides: GlobalThemeOverrides = {
</script> </script>
<template> <template>
<n-config-provider <n-config-provider class="h-full w-full" :theme="theme" :theme-overrides="themeOverrides" :locale="zhCN"
class="h-full w-full" :date-locale="dateZhCN">
:theme="theme"
:theme-overrides="themeOverrides"
:locale="zhCN"
:date-locale="dateZhCN"
>
<n-loading-bar-provider> <n-loading-bar-provider>
<n-message-provider> <n-message-provider>
<n-notification-provider> <n-notification-provider>
<n-dialog-provider> <n-dialog-provider>
<n-watermark <n-watermark content="TODO 水印" cross fullscreen :font-size="12" :line-height="16" :width="384" :height="384"
content="TODO 水印" :x-offset="12" :y-offset="60" :rotate="-15" />
cross
fullscreen
:font-size="12"
:line-height="16"
:width="384"
:height="384"
:x-offset="12"
:y-offset="60"
:rotate="-15"
/>
<RouterView /> <RouterView />
</n-dialog-provider> </n-dialog-provider>
</n-notification-provider> </n-notification-provider>

16
src/api/api.d.ts vendored

@ -1,9 +1,25 @@
declare namespace API {
// 分页模型
interface Pagination { interface Pagination {
size?: number size?: number
current?: number current?: number
total?: number total?: number
} }
// 时间模型
interface TimeInfo {
createdAt?: string
updatedAt?: string
}
// 基础ID
interface BaseID { interface BaseID {
id?: string id?: string
} }
// 验证码请求
interface CaptchaReq {
captchaId: string
captcha: string
}
}

61
src/api/auth.d.ts vendored

@ -0,0 +1,61 @@
declare namespace API {
// OAuth 登录请求(网页登录)
interface OauthLoginReq {
// 服务提供商名称
provider: string
}
// OAuth 登录返回登录页(网页登录)
interface OauthLoginResp {
// 提供商登录地址
AuthUrl: string
}
// OAuth Code 登录请求
interface OauthLoginByCodeReq {
code: string
provider: string
}
// OAuth 手机号登录请求
interface OauthLoginByPhoneCodeReq {
authCode?: string
code: string
provider: string
}
// 登录请求
type LoginReq = Partial<CaptchaReq> & {
// 登录主体(用户名/邮箱/手机号码)| 作用于验证码时,不支持用户名
subject: string
// 登录凭证
credentials: string
// 当前登录平台
platform: string
}
// 登录Token信息
interface LoginTokenInfo {
uid: string
token_type: string
access_token: string
expires_at: Number
scope: string
}
// 登录返回
interface LoginResp {
twoFactorType: string
token: LoginTokenInfo
}
// 注册请求
type RegisterReq = Partial<CaptchaReq> & Partial<{
username: string
email: string
phoneNumber: string
code: string
}> & {
credentials: string
}
}

@ -1,7 +1,55 @@
import { defHttp } from '~/utils/http' import { defHttp } from '~/utils/http'
export function login() { // 密码登录
defHttp.post({ export function login(data: API.LoginReq) {
defHttp.post<API.LoginResp>({
url: '/api/auth/login', url: '/api/auth/login',
}) method: 'POST',
data
}, { withToken: false })
}
// 验证码登录手机x邮箱
export function loginByCode(data: API.LoginReq) {
defHttp.post<API.LoginResp>({
url: '/api/auth/login/byCode',
method: 'POST',
data
}, { withToken: false })
}
// Oauth 第三方登录获取登录地址通常针对PC网页登录APP端自行获取code
export function oauthLogin(params: API.OauthLoginReq) {
defHttp.post<API.OauthLoginResp>({
url: '/api/auth/oauth/login',
method: 'GET',
params
}, { withToken: false })
}
// Oauth 第三方登录客户端自行获取code进行登录
export function oauthLoginByCode(data: API.OauthLoginByCodeReq) {
defHttp.post<API.LoginResp>({
url: '/api/auth/oauth/login/byCode',
method: 'POST',
data
}, { withToken: false })
}
// Oauth 第三方登录客户端获取换取手机号的code进行登录
export function oauthLoginByPhone(data: API.OauthLoginByPhoneCodeReq) {
defHttp.post<API.LoginResp>({
url: '/api/auth/oauth/login/byPhone',
method: 'POST',
data
}, { withToken: false })
}
// 用户注册
export function register(data: API.RegisterReq) {
defHttp.post<API.BaseID>({
url: '/api/auth/register',
method: 'POST',
data
}, { withToken: false })
} }

@ -1,6 +1,7 @@
/* eslint-disable */ /* eslint-disable */
/* prettier-ignore */ /* prettier-ignore */
// @ts-nocheck // @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import // Generated by unplugin-auto-import
export {} export {}
declare global { declare global {
@ -50,9 +51,14 @@ declare global {
const isReactive: typeof import('vue')['isReactive'] const isReactive: typeof import('vue')['isReactive']
const isReadonly: typeof import('vue')['isReadonly'] const isReadonly: typeof import('vue')['isReadonly']
const isRef: typeof import('vue')['isRef'] const isRef: typeof import('vue')['isRef']
const login: typeof import('./api/auth/auth')['login']
const loginByCode: typeof import('./api/auth/auth')['loginByCode']
const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable'] const makeDestructurable: typeof import('@vueuse/core')['makeDestructurable']
const markRaw: typeof import('vue')['markRaw'] const markRaw: typeof import('vue')['markRaw']
const nextTick: typeof import('vue')['nextTick'] const nextTick: typeof import('vue')['nextTick']
const oauthLogin: typeof import('./api/auth/auth')['oauthLogin']
const oauthLoginByCode: typeof import('./api/auth/auth')['oauthLoginByCode']
const oauthLoginByPhone: typeof import('./api/auth/auth')['oauthLoginByPhone']
const onActivated: typeof import('vue')['onActivated'] const onActivated: typeof import('vue')['onActivated']
const onBeforeMount: typeof import('vue')['onBeforeMount'] const onBeforeMount: typeof import('vue')['onBeforeMount']
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave'] const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
@ -88,6 +94,7 @@ declare global {
const refDefault: typeof import('@vueuse/core')['refDefault'] const refDefault: typeof import('@vueuse/core')['refDefault']
const refThrottled: typeof import('@vueuse/core')['refThrottled'] const refThrottled: typeof import('@vueuse/core')['refThrottled']
const refWithControl: typeof import('@vueuse/core')['refWithControl'] const refWithControl: typeof import('@vueuse/core')['refWithControl']
const register: typeof import('./api/auth/auth')['register']
const resolveComponent: typeof import('vue')['resolveComponent'] const resolveComponent: typeof import('vue')['resolveComponent']
const resolveRef: typeof import('@vueuse/core')['resolveRef'] const resolveRef: typeof import('@vueuse/core')['resolveRef']
const resolveUnref: typeof import('@vueuse/core')['resolveUnref'] const resolveUnref: typeof import('@vueuse/core')['resolveUnref']
@ -307,7 +314,7 @@ declare global {
// for type re-export // for type re-export
declare global { declare global {
// @ts-ignore // @ts-ignore
export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode } from 'vue' export type { Component, ComponentPublicInstance, ComputedRef, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
} }
// for vue template auto import // for vue template auto import
import { UnwrapRef } from 'vue' import { UnwrapRef } from 'vue'
@ -346,7 +353,6 @@ declare module 'vue' {
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']> readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']> readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']>
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']> readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
readonly envD: UnwrapRef<typeof import('./types/env.d')['default']>
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']> readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']> readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']> readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
@ -359,9 +365,14 @@ declare module 'vue' {
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']> readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']> readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']> readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly login: UnwrapRef<typeof import('./api/auth/auth')['login']>
readonly loginByCode: UnwrapRef<typeof import('./api/auth/auth')['loginByCode']>
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']> readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']> readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']> readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
readonly oauthLogin: UnwrapRef<typeof import('./api/auth/auth')['oauthLogin']>
readonly oauthLoginByCode: UnwrapRef<typeof import('./api/auth/auth')['oauthLoginByCode']>
readonly oauthLoginByPhone: UnwrapRef<typeof import('./api/auth/auth')['oauthLoginByPhone']>
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']> readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']> readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
readonly onBeforeRouteLeave: UnwrapRef<typeof import('vue-router')['onBeforeRouteLeave']> readonly onBeforeRouteLeave: UnwrapRef<typeof import('vue-router')['onBeforeRouteLeave']>
@ -397,6 +408,7 @@ declare module 'vue' {
readonly refDefault: UnwrapRef<typeof import('@vueuse/core')['refDefault']> readonly refDefault: UnwrapRef<typeof import('@vueuse/core')['refDefault']>
readonly refThrottled: UnwrapRef<typeof import('@vueuse/core')['refThrottled']> readonly refThrottled: UnwrapRef<typeof import('@vueuse/core')['refThrottled']>
readonly refWithControl: UnwrapRef<typeof import('@vueuse/core')['refWithControl']> readonly refWithControl: UnwrapRef<typeof import('@vueuse/core')['refWithControl']>
readonly register: UnwrapRef<typeof import('./api/auth/auth')['register']>
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']> readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
readonly resolveRef: UnwrapRef<typeof import('@vueuse/core')['resolveRef']> readonly resolveRef: UnwrapRef<typeof import('@vueuse/core')['resolveRef']>
readonly resolveUnref: UnwrapRef<typeof import('@vueuse/core')['resolveUnref']> readonly resolveUnref: UnwrapRef<typeof import('@vueuse/core')['resolveUnref']>
@ -649,7 +661,6 @@ declare module '@vue/runtime-core' {
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']> readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']> readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']>
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']> readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
readonly envD: UnwrapRef<typeof import('./types/env.d')['default']>
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']> readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']> readonly getCurrentInstance: UnwrapRef<typeof import('vue')['getCurrentInstance']>
readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']> readonly getCurrentScope: UnwrapRef<typeof import('vue')['getCurrentScope']>
@ -662,9 +673,14 @@ declare module '@vue/runtime-core' {
readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']> readonly isReactive: UnwrapRef<typeof import('vue')['isReactive']>
readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']> readonly isReadonly: UnwrapRef<typeof import('vue')['isReadonly']>
readonly isRef: UnwrapRef<typeof import('vue')['isRef']> readonly isRef: UnwrapRef<typeof import('vue')['isRef']>
readonly login: UnwrapRef<typeof import('./api/auth/auth')['login']>
readonly loginByCode: UnwrapRef<typeof import('./api/auth/auth')['loginByCode']>
readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']> readonly makeDestructurable: UnwrapRef<typeof import('@vueuse/core')['makeDestructurable']>
readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']> readonly markRaw: UnwrapRef<typeof import('vue')['markRaw']>
readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']> readonly nextTick: UnwrapRef<typeof import('vue')['nextTick']>
readonly oauthLogin: UnwrapRef<typeof import('./api/auth/auth')['oauthLogin']>
readonly oauthLoginByCode: UnwrapRef<typeof import('./api/auth/auth')['oauthLoginByCode']>
readonly oauthLoginByPhone: UnwrapRef<typeof import('./api/auth/auth')['oauthLoginByPhone']>
readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']> readonly onActivated: UnwrapRef<typeof import('vue')['onActivated']>
readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']> readonly onBeforeMount: UnwrapRef<typeof import('vue')['onBeforeMount']>
readonly onBeforeRouteLeave: UnwrapRef<typeof import('vue-router')['onBeforeRouteLeave']> readonly onBeforeRouteLeave: UnwrapRef<typeof import('vue-router')['onBeforeRouteLeave']>
@ -700,6 +716,7 @@ declare module '@vue/runtime-core' {
readonly refDefault: UnwrapRef<typeof import('@vueuse/core')['refDefault']> readonly refDefault: UnwrapRef<typeof import('@vueuse/core')['refDefault']>
readonly refThrottled: UnwrapRef<typeof import('@vueuse/core')['refThrottled']> readonly refThrottled: UnwrapRef<typeof import('@vueuse/core')['refThrottled']>
readonly refWithControl: UnwrapRef<typeof import('@vueuse/core')['refWithControl']> readonly refWithControl: UnwrapRef<typeof import('@vueuse/core')['refWithControl']>
readonly register: UnwrapRef<typeof import('./api/auth/auth')['register']>
readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']> readonly resolveComponent: UnwrapRef<typeof import('vue')['resolveComponent']>
readonly resolveRef: UnwrapRef<typeof import('@vueuse/core')['resolveRef']> readonly resolveRef: UnwrapRef<typeof import('@vueuse/core')['resolveRef']>
readonly resolveUnref: UnwrapRef<typeof import('@vueuse/core')['resolveUnref']> readonly resolveUnref: UnwrapRef<typeof import('@vueuse/core')['resolveUnref']>

@ -3,11 +3,9 @@
// @ts-nocheck // @ts-nocheck
// Generated by unplugin-vue-components // Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399 // Read more: https://github.com/vuejs/core/pull/3399
import '@vue/runtime-core'
export {} export {}
declare module '@vue/runtime-core' { declare module 'vue' {
export interface GlobalComponents { export interface GlobalComponents {
NConfigProvider: typeof import('naive-ui')['NConfigProvider'] NConfigProvider: typeof import('naive-ui')['NConfigProvider']
NDialogProvider: typeof import('naive-ui')['NDialogProvider'] NDialogProvider: typeof import('naive-ui')['NDialogProvider']

@ -18,9 +18,3 @@ interface ImportMetaEnv {
} }
interface ImportMeta {readonly env: ImportMetaEnv} interface ImportMeta {readonly env: ImportMetaEnv}
declare module "*.vue" {
import type { DefineComponent } from "vue"
const component: DefineComponent<{}, {}, any>
export default component
}

@ -23,7 +23,8 @@
"vite-plugin-vue-component-preview/client", "vite-plugin-vue-component-preview/client",
"vite-plugin-vue-layouts/client", "vite-plugin-vue-layouts/client",
"vite-plugin-pwa/client", "vite-plugin-pwa/client",
"unplugin-vue-macros/macros-global" "unplugin-vue-macros/macros-global",
"naive-ui",
], ],
"paths": { "paths": {
"~/*": ["src/*"], "~/*": ["src/*"],
@ -38,10 +39,9 @@
] ]
}, },
"exclude": ["dist", "node_modules", "cypress"], "exclude": ["dist", "node_modules", "cypress"],
"include": [ // "include": [
"src/**/*", // // "src/**/*",
"src/**/*.d.ts", // // "src/types/**/*.d.ts",
"src/types/**/*.d.ts", // // "src/**/types/**/*.d.ts"
"src/**/types/**/*.d.ts" // ]
]
} }

@ -6,20 +6,20 @@ import generateSitemap from 'vite-ssg-sitemap'
import Layouts from 'vite-plugin-vue-layouts' import Layouts from 'vite-plugin-vue-layouts'
import Components from 'unplugin-vue-components/vite' import Components from 'unplugin-vue-components/vite'
import AutoImport from 'unplugin-auto-import/vite' import AutoImport from 'unplugin-auto-import/vite'
import Markdown from 'vite-plugin-vue-markdown' import Markdown from 'unplugin-vue-markdown/vite'
import { VitePWA } from 'vite-plugin-pwa' import VueMacros from 'unplugin-vue-macros/vite'
import VueI18n from '@intlify/unplugin-vue-i18n/vite' import VueI18n from '@intlify/unplugin-vue-i18n/vite'
import { VitePWA } from 'vite-plugin-pwa'
import VueDevTools from 'vite-plugin-vue-devtools' import VueDevTools from 'vite-plugin-vue-devtools'
import LinkAttributes from 'markdown-it-link-attributes' import LinkAttributes from 'markdown-it-link-attributes'
import Unocss from 'unocss/vite' import Unocss from 'unocss/vite'
import Shiki from 'markdown-it-shiki' import Shiki from 'markdown-it-shiki'
import WebfontDownload from 'vite-plugin-webfont-dl'
// custom
import { transformShortVmodel } from '@vue-macros/short-vmodel' import { transformShortVmodel } from '@vue-macros/short-vmodel'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers' import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
// @ts-expect-error failed to resolve types
import VueMacros from 'unplugin-vue-macros/vite'
import WebfontDownload from 'vite-plugin-webfont-dl'
export default defineConfig({ export default defineConfig({
resolve: { resolve: {
alias: { alias: {
@ -76,6 +76,7 @@ export default defineConfig({
'src/composables', 'src/composables',
'src/stores', 'src/stores',
'src/types', 'src/types',
'src/api',
'src/api/**', 'src/api/**',
], ],
vueTemplate: true, vueTemplate: true,

Loading…
Cancel
Save