import { defineNuxtConfig } from 'nuxt/config' import { resolve } from 'node:path' import { getI18n } from './i18n.config' export default defineNuxtConfig({ app: { head: { viewport: 'width=device-width, initial-scale=1, maximum-scale=5', script: [ { type: 'text/javascript', src: process.env.STOVE_GNB, }, { type: 'text/javascript', src: process.env.STOVE_81PLUG, }, { type: 'text/javascript', src: process.env.STOVE_LAUNCHER_SCRIPT, async: true, defer: true, }, ], }, }, modules: [ '@vueuse/nuxt', '@nuxtjs/i18n', '@pinia/nuxt', '@nuxtjs/tailwindcss', 'nuxt-gtag', '@nuxtjs/device', ], imports: { dirs: [ 'layers/types', 'layers/components', 'layers/composables', 'layers/layouts', 'layers/middleware', 'layers/plugins', 'layers/registry', 'layers/server', 'layers/stores', 'layers/utils', ], global: true, }, components: { dirs: ['~/components', 'layers/components'], global: true, }, alias: { '@': resolve(__dirname, '.'), '#layers': resolve(__dirname, 'layers'), }, extends: ['./layers'], // i18n 설정 - 런타임에 동적으로 설정됨 i18n: getI18n(), experimental: { payloadExtraction: false, }, typescript: { typeCheck: true, strict: false, }, nitro: { prerender: { routes: [] }, }, // [test] Nuxt가 pages 스캔하도록 명시 pages: true, // 런타임 환경 변수 설정 runtimeConfig: { public: { runType: process.env.RUN_TYPE, baseDomain: process.env.BASE_DOMAIN, staticUrl: process.env.STATIC_URL, assetsUrl: process.env.ASSETS_URL, dataResourcesUrl: process.env.DATA_RESOURCE_URL, stoveApiUrl: process.env.STOVE_API_URL, stoveApiUrlServer: process.env.STOVE_API_URL_SERVERL, stoveMaintenanceApiUrl: process.env.STOVE_M_API_URL, stoveGnb: process.env.STOVE_GNB, stoveCs: process.env.STOVE_CS, stoveLauncherScript: process.env.STOVE_LAUNCHER_SCRIPT, stoveClientDownloadUrl: process.env.STOVE_CLIENT_DOWNLOAD_URL, stoveLoginUrl: process.env.STOVE_LOGIN_URL, stove81Plug: process.env.STOVE_81PLUG, }, }, postcss: { plugins: { tailwindcss: {}, autoprefixer: {}, }, }, vite: { server: { // 개발 환경에서는 모든 호스트 허용 allowedHosts: true, }, base: '/', }, })