// https://nuxt.com/docs/api/configuration/nuxt-config
import VitePluginSRI from 'vite-plugin-sri';
export default defineNuxtConfig({  
  typescript: {
    strict: false,
    typeCheck: false
  },
  ssr: false,  
  app: {
    head: {
      titleTemplate: '',
      title: 'ShopDeli',
      htmlAttrs: {
        lang: 'ko'
      },
      link: [
        { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
      ],
      script: [
        { type: 'text/javascript', src: '//t1.daumcdn.net/mapjsapi/bundle/postcode/prod/postcode.v2.js' },
        { type: 'text/javascript', src: "/js/jquery-3.7.1.min.js" },
      ]
    },
  },  
  devtools: { enabled: false },
  devServer : {
    host: '0.0.0.0'
  },
  build: {
    transpile: ['vuetify'],   
  },   
  css: [
    'ag-grid-community/styles/ag-grid.css', 
    'ag-grid-community/styles/ag-theme-quartz.css',
    'pretendard/dist/web/static/pretendard.css',
    '~/assets/scss/main.scss',
    'vuetify/lib/styles/main.sass',
    '@mdi/font/css/materialdesignicons.min.css',
    '@fortawesome/fontawesome-svg-core/styles.css'
  ],
  modules: [
    '@pinia/nuxt',
    '@pinia-plugin-persistedstate/nuxt',
    'nuxt-lodash',
    'dayjs-nuxt',
  ],
  plugins: [    
    { src: '~/plugins/userAgent.js', mode: 'client'},
    { src: '~/plugins/vue3-editor.js', mode: 'client'},
    { src: '~/plugins/vue-cool-lightbox.js', mode: 'client'},
    { src: '~/plugins/fontawesome.js', mode: 'client'}
  ],
  lodash: {
    prefix: "_",
    prefixSkip: ["string"],
    upperAfterPrefix: false,
    exclude: ["map"],
    alias: [
      ["camelCase", "stringToCamelCase"], // => stringToCamelCase
      ["kebabCase", "stringToKebab"], // => stringToKebab
      ["isDate", "isLodashDate"], // => _isLodashDate
    ],
  },
  dayjs: {
    locales: ['en', 'ja'],
    defaultLocale: 'en',
    defaultTimezone: 'Asia/Tokyo',
    plugins: ['relativeTime', 'utc', 'timezone']
  },
  builder: 'vite',
  vite: {
    base: import.meta.env.VITE_APP_BASE_URL,
    define: {
      'process.env.DEBUG': false,
    },    
    plugins: [
      VitePluginSRI(),
    ],
    build: {
      chunkSizeWarningLimit: 1600,
      sourcemap: true,
      rollupOptions: {
        output: {
          chunkFileNames: '_nuxt/chunks/[name].js',
          entryFileNames: '_nuxt/js/[name].js',
          assetFileNames: '_nuxt/[name].[ext]',
        }
      },
    }
  },

  compatibilityDate: '2024-08-23',
})