refactor(nuxt.config): 调整配置格式并添加vite服务器设置

- 统一代码缩进和引号风格
- 添加vite服务器构建配置以优化模块处理
- 保持原有功能不变
This commit is contained in:
DESKTOP-RQ919RC\Pc 2025-07-08 12:30:49 +08:00
parent 1ed448042f
commit 5b352f352f

View File

@ -1,32 +1,43 @@
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({ export default defineNuxtConfig({
ssr: true, vite: {
components: true, $server: {
buildModules: ['@nuxtjs/composition-api/module'], build: {
rollupOptions: {
output: {
preserveModules: false,
},
},
},
},
},
ssr: true,
components: true,
buildModules: ["@nuxtjs/composition-api/module"],
env: { env: {
baseUrl: process.env.BASE_URL || "http://localhost:3000", baseUrl: process.env.BASE_URL || "http://localhost:3000",
}, },
app: { app: {
buildAssetsDir: "/static/", buildAssetsDir: "/static/",
head: { head: {
link: [ link: [
{ {
rel: "stylesheet", rel: "stylesheet",
href: "//bbs.gter.net/data/cache/style_2_common.css?Z62", href: "//bbs.gter.net/data/cache/style_2_common.css?Z62",
}, },
], ],
script: [ script: [
{src: "https://app.gter.net/bottom?tpl=header&menukey=ask"}, { src: "https://app.gter.net/bottom?tpl=header&menukey=ask" },
{src: "https://app.gter.net/bottom?tpl=footer,popupnotification", body: true}, { src: "https://app.gter.net/bottom?tpl=footer,popupnotification", body: true },
{ {
src: "https://bbs.gter.net/static/js/common.js", src: "https://bbs.gter.net/static/js/common.js",
body: true body: true,
}, },
{ {
innerHTML: ` innerHTML: `
window.userInfoWin = {} window.userInfoWin = {}
STYLEID = "2"; STYLEID = "2";
STATICURL = "static/"; STATICURL = "static/";
@ -45,24 +56,24 @@ export default defineNuxtConfig({
REPORTURL = "aHR0cDovL2Jicy5ndGVyLm5ldC9mb3J1bS5waHA/dGlkPTI0MDYzNTYmZ290bz1sYXN0cG9zdA=="; REPORTURL = "aHR0cDovL2Jicy5ndGVyLm5ldC9mb3J1bS5waHA/dGlkPTI0MDYzNTYmZ290bz1sYXN0cG9zdA==";
SITEURL = "https://ask.gter.net/"; SITEURL = "https://ask.gter.net/";
JSPATH = "static/js/";`, JSPATH = "static/js/";`,
type: "text/javascript", type: "text/javascript",
}, },
], ],
}, },
}, },
head: { head: {
meta: [{charset: "utf-8"}, {name: "viewport", content: "width=device-width, initial-scale=1"}, {"http-equiv": "Cache-Control", content: "no-cache, no-store, must-revalidate"}, {"http-equiv": "Pragma", content: "no-cache"}, {"http-equiv": "Expires", content: "0"}], meta: [{ charset: "utf-8" }, { name: "viewport", content: "width=device-width, initial-scale=1" }, { "http-equiv": "Cache-Control", content: "no-cache, no-store, must-revalidate" }, { "http-equiv": "Pragma", content: "no-cache" }, { "http-equiv": "Expires", content: "0" }],
}, },
devtools: {enabled: true}, devtools: { enabled: true },
build: { build: {
loaders: { loaders: {
imgUrl: {limit: 10000}, imgUrl: { limit: 10000 },
}, },
}, },
modules: ['@element-plus/nuxt'], modules: ["@element-plus/nuxt"],
compatibilityDate: "2025-03-21", compatibilityDate: "2025-03-21",
}) });