Files
web-temp/nuxt.config.ts

135 lines
3.4 KiB
TypeScript

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',
link: [
// 폰트 CSS 비동기 로딩
{
rel: 'preload',
href: 'https://static-pubcomm.onstove.com/live/common/assets/fonts/Pretendard/pretendard.css',
as: 'style',
onload: "this.onload=null;this.rel='stylesheet'",
},
{
rel: 'preload',
href: 'https://static-pubcomm.onstove.com/live/common/assets/fonts/Pretendard/pretendard-jp.css',
as: 'style',
onload: "this.onload=null;this.rel='stylesheet'",
},
// {
// rel: 'preload',
// href: 'https://static-cdn.onstove.com/0.0.4/font-icon/StoveFont-Icon.css',
// as: 'style',
// onload: "this.onload=null;this.rel='stylesheet'",
// },
],
script: [
{
type: 'text/javascript',
src: process.env.STOVE_GNB,
defer: true,
},
{
type: 'text/javascript',
src: process.env.STOVE_81PLUG,
defer: true,
},
{
type: 'text/javascript',
src: process.env.STOVE_LAUNCHER_SCRIPT,
defer: true,
},
],
},
},
modules: [
'@vueuse/nuxt',
'@pinia/nuxt',
'@nuxtjs/i18n',
'@nuxtjs/tailwindcss',
'nuxt-gtag',
'@nuxtjs/device',
'motion-v/nuxt',
],
extends: ['./layers'],
alias: {
'@': resolve(__dirname, '.'),
'#layers': resolve(__dirname, 'layers'),
},
// i18n 설정 - 런타임에 동적으로 설정됨
i18n: getI18n(),
typescript: {
typeCheck: true,
strict: false,
},
// [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,
stoveCouponUrl: process.env.STOVE_COUPON_URL,
stoveMCouponUrl: process.env.STOVE_M_COUPON_URL,
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,
},
},
css: [
'@vuepic/vue-datepicker/dist/main.css',
'@splidejs/vue-splide/css',
'@/layers/assets/css/app.css',
],
postcss: {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
},
vite: {
server: {
// 개발 환경에서는 모든 호스트 허용
allowedHosts: true,
},
base: '/',
},
experimental: {
payloadExtraction: false,
},
nitro: {
prerender: { routes: [] },
compressPublicAssets: true,
minify: true,
// 캐시 헤더 최적화
routeRules: {
// 폰트: 1년 캐시
'**/*.{woff,woff2,ttf,eot}': {
headers: {
'Cache-Control': 'public, max-age=31536000',
},
},
},
},
})