2026-01-16 22:04:12 +08:00
|
|
|
// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
|
2026-04-07 11:01:11 +08:00
|
|
|
import path from 'path'
|
|
|
|
|
|
2026-01-16 22:04:12 +08:00
|
|
|
export default defineNuxtConfig({
|
|
|
|
|
modules: [
|
|
|
|
|
'@nuxt/eslint',
|
|
|
|
|
'@vueuse/nuxt',
|
|
|
|
|
'@unocss/nuxt',
|
|
|
|
|
'@pinia/nuxt',
|
|
|
|
|
'@element-plus/nuxt',
|
2026-04-07 11:01:11 +08:00
|
|
|
'nuxt-icons',
|
|
|
|
|
'pinia-plugin-persistedstate/nuxt'
|
2026-01-16 22:04:12 +08:00
|
|
|
],
|
|
|
|
|
|
|
|
|
|
devtools: {
|
|
|
|
|
enabled: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
app: {
|
2026-04-18 13:52:56 +00:00
|
|
|
baseURL: '/web',
|
2026-01-16 22:04:12 +08:00
|
|
|
head: {
|
2026-04-07 11:01:11 +08:00
|
|
|
htmlAttrs: {
|
|
|
|
|
lang: 'zh-cn'
|
|
|
|
|
}
|
2026-01-16 22:04:12 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
// css
|
|
|
|
|
css: [
|
2026-04-07 11:01:11 +08:00
|
|
|
'~/assets/css/uno-reset.css',
|
2026-01-16 22:04:12 +08:00
|
|
|
'~/assets/scss/index.scss'
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
// vueuse
|
|
|
|
|
vueuse: {
|
|
|
|
|
ssrHandlers: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
future: {
|
|
|
|
|
compatibilityVersion: 4,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
experimental: {
|
|
|
|
|
// when using generate, payload js assets included in sw precache manifest
|
|
|
|
|
// but missing on offline, disabling extraction it until fixed
|
|
|
|
|
payloadExtraction: false,
|
|
|
|
|
renderJsonPayloads: true,
|
|
|
|
|
typedPages: true,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
compatibilityDate: '2024-08-14',
|
|
|
|
|
|
|
|
|
|
nitro: {
|
|
|
|
|
esbuild: {
|
|
|
|
|
options: {
|
|
|
|
|
target: 'esnext',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
prerender: {
|
|
|
|
|
crawlLinks: false,
|
|
|
|
|
routes: ['/'],
|
|
|
|
|
ignore: ['/hi'],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
vite: {
|
|
|
|
|
css: {
|
|
|
|
|
preprocessorOptions: {
|
|
|
|
|
scss: {
|
2026-01-19 17:32:23 +08:00
|
|
|
additionalData: `@use "@/assets/scss/element/index.scss" as element;`
|
2026-01-16 22:04:12 +08:00
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
server: {
|
|
|
|
|
proxy: {
|
|
|
|
|
"/api": {
|
2026-04-07 11:01:11 +08:00
|
|
|
target: "http://127.0.0.1:8001",
|
2026-01-16 22:04:12 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: (path) => path.replace(/^\/api/, "/api"),
|
|
|
|
|
},
|
2026-04-07 11:01:11 +08:00
|
|
|
"/upload": {
|
|
|
|
|
target: "http://127.0.0.1:8001",
|
|
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: (path) => path.replace(/^\/upload/, "/upload"),
|
|
|
|
|
},
|
2026-01-16 22:04:12 +08:00
|
|
|
},
|
|
|
|
|
},
|
2026-04-07 11:01:11 +08:00
|
|
|
optimizeDeps: {
|
|
|
|
|
include: ['@wangeditor/editor', '@wangeditor/editor-for-vue'],
|
|
|
|
|
},
|
2026-01-16 22:04:12 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
|
|
elementPlus: {
|
|
|
|
|
icon: 'ElIcon',
|
|
|
|
|
importStyle: 'scss',
|
|
|
|
|
themes: ['dark'],
|
|
|
|
|
},
|
2026-04-17 15:12:42 +08:00
|
|
|
ssr: false,
|
2026-01-16 22:04:12 +08:00
|
|
|
})
|