xiaoai/php_pc/nuxt.config.ts

79 lines
2.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { URL, fileURLToPath } from "node:url";
import { createSvgIconsPlugin } from "vite-plugin-svg-icons";
import { getEnvConfig } from "./nuxt/env";
const envConfig = getEnvConfig();
export default defineNuxtConfig({
srcDir: "src/",
css: ["@/assets/styles/index.scss"],
modules: ["@pinia/nuxt", "@nuxtjs/tailwindcss", "@element-plus/nuxt"],
app: {
baseURL: envConfig.baseUrl,
head: {
title: "",
meta: [
{
name: "description",
content:
"专注于AI数字员工解决方案为企业提供智能化的虚拟助手和自动化员工提升工作效率降低人力成本。支持多场景应用助力企业数字化转型。",
},
{
name: "keywords",
content: "AI数字员工, 虚拟助手, 自动化员工, 数字化转型, 智能化办公, 人工智能员工, 企业AI解决方案",
},
{
name: "og:title",
content: "AI数字员工系统开源AI应用解决方案",
},
{
name: "og:robots",
content: "noarchive, max-image-preview:large, max-video-preview:-1",
},
],
link: [
{
rel: "icon",
href: "/favicon.ico",
},
],
},
},
spaLoadingTemplate: "spa-loading.html",
runtimeConfig: {
public: {
...envConfig,
},
},
// ssr: !!envConfig.ssr,
ssr: true,
nitro: {
externals: {inline: ['@matechat/core']},
preset: 'node-server',
prerender: {
routes: [],
crawlLinks: false,
failOnError: false
},
},
vite: {
ssr: {
noExternal: ['@matechat/core'],
},
plugins: [
createSvgIconsPlugin({
iconDirs: [fileURLToPath(new URL("./src/assets/icons", import.meta.url))],
symbolId: "local-icon-[dir]-[name]",
}),
],
server: {
proxy: {
'/api': {
target: 'https://superai.luxe',
changeOrigin: true,
// 如果需要,添加路径重写
// rewrite: (path) => path.replace(/^\/api/, '')
},
}
},
},
});