// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
  compatibilityDate: "2025-05-15",
  devtools: { enabled: true },
  modules: [
    "@nuxt/eslint",
    "@nuxt/image",
    "@nuxt/icon",
    "@pinia/nuxt",
    "pinia-plugin-persistedstate/nuxt",
    "@nuxtjs/tailwindcss",
  ],
  piniaPluginPersistedstate: {
    storage: "localStorage",
  },
  vite: {
    optimizeDeps: {
      include: ["cytoscape-overlays"],
    },
    build: {
      commonjsOptions: {
        transformMixedEsModules: true,
      },
    },
  },
  nitro: {
    logLevel: "debug",
  },
  runtimeConfig: {
    public: {
      apiBase: process.env.API_BASE || "http://localhost",
      contextPath: process.env.CONTEXT_PATH || "/service",
    },
  },
  typescript: {
    shim: false,
    strict: true,
  },
  plugins: ["~/plugins/vue3-tui-grid.client.ts"],
  components: [
    { path: "~/components/base", pathPrefix: false }, // @base/ 접두사 제거
    { path: "~/components/layout", pathPrefix: false }, // @layout/ 접두사 제거
    { path: "~/components/domain", pathPrefix: true }, // @domain/ 접두사 유지
  ],
});
