import fs from "fs"; import vuetify from "vite-plugin-vuetify"; import { NuxtI18nOptions } from "@nuxtjs/i18n"; import { fa } from "vuetify/lib/locale"; /** * Nuxt configuration * * @see https://nuxt.com/docs/api/configuration/nuxt-config */ export default defineNuxtConfig({ css: ["~/assets/css/main.css"], ssr: false, title: "Opentalent", runtimeConfig: { // Private config that is only available on the server env: "", apiBaseUrl: process.env.NUXT_API_BASE_URL, // Config within public will be also exposed to the client public: { env: "", apiBaseUrl: "", }, }, hooks: { "builder:watch": console.log, }, app: { head: { title: "Opentalent", meta: [ { charset: "utf-8" }, { name: "viewport", content: "width=device-width, initial-scale=1" }, { hid: "description", name: "description", content: "" }, ], link: [ { rel: "icon", type: "image/x-icon", href: "/favicon.ico" }, { rel: "stylesheet", href: "https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;700&display=swap", }, ], }, }, typescript: { strict: true, }, modules: [ async (options, nuxt) => { nuxt.hooks.hook( "vite:extendConfig", (config) => (config.plugins ?? []).push( vuetify() //Remplacer par cela quand l'issue https://github.com/vuetifyjs/vuetify-loader/issues/273 sera règlée.. // voir aussi : https://github.com/nuxt/nuxt/issues/15412 et https://github.com/vuetifyjs/vuetify-loader/issues/290 // vuetify({ // styles: { configFile: './assets/css/settings.scss' } // }) ) as any ); }, [ "@pinia/nuxt", { autoImports: [ // automatically imports `usePinia()` "defineStore", // automatically imports `usePinia()` as `usePiniaStore()` ["defineStore", "definePiniaStore"], ], }, ], "@pinia-orm/nuxt", "nuxt-lodash", "@nuxtjs/i18n", "@nuxt/devtools", ], webfontloader: { google: { families: ["Barlow:300,400,500,700&display=swap"], }, }, devtools: { // @see https://github.com/nuxt/devtools enabled: false, }, vite: { esbuild: { drop: process.env.DEBUG ? [] : ["console", "debugger"], }, ssr: { noExternal: ["vuetify", "nuxt-lodash"], }, server: { https: { key: fs.readFileSync("local.portail_v2.opentalent.fr.key"), cert: fs.readFileSync("local.portail_v2.opentalent.fr.crt"), }, //@ts-ignore port: 443, hmr: { protocol: "wss", port: 24680, }, }, }, vuetify: { styles: { configFile: "src/vuetify.scss" }, }, i18n: { langDir: "lang", lazy: true, locales: [ { code: "fr", iso: "fr-FR", file: "fr.json", name: "Français", }, ], defaultLocale: "fr", detectBrowserLanguage: false, vueI18n: { legacy: false, datetimeFormats: { "fr-FR": { short: { year: "numeric", month: "numeric", day: "numeric", }, long: { year: "numeric", month: "numeric", day: "numeric", hour: "numeric", minute: "numeric", }, }, }, }, } as NuxtI18nOptions, build: { transpile: ["vuetify"], }, });