配置文件
nuxt.config.ts
提示
版本 v3.x
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
compatibilityDate: "2024-11-01",
devtools: { enabled: true },
// ! + 添加的任何模块都可能导致,依赖缺失无法运行
modules: [
// "@nuxt/ui",
],
// +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
// + 启用 Server Side rendering
// ssr: true,
// + 此选项允许您定义 Nuxt 应用程序的源目录。
// srcDir: "src/",
// + 此选项允许您定义 Nuxt 目录的自定义名称。
// dir: {
// pages: "pages",
// },
// + 页面设置
// app: {
// // 用于管理应用的 head 和 SEO 元标签。
// head: {
// title: "this.title",
// charset: 'utf-16',
// viewport: 'width=device-width, initial-scale=1, maximum-scale=1',
// meta: [
// { name: "viewport", content: "width=device-width, initial-scale=1" },
// ],
// },
// },
// + 运行时配置
// runtimeConfig: {
// // Private config that is only available on the server
// apiSecret: '123',
// // Config within public will be also exposed to the client
// public: {
// apiBase: '/api',
// },
// },
});