nuxt.config.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. import fs from "fs";
  2. import vuetify from "vite-plugin-vuetify";
  3. import { NuxtI18nOptions } from "@nuxtjs/i18n";
  4. import { fa } from "vuetify/lib/locale";
  5. /**
  6. * Nuxt configuration
  7. *
  8. * @see https://nuxt.com/docs/api/configuration/nuxt-config
  9. */
  10. export default defineNuxtConfig({
  11. ssr: false,
  12. title: "Opentalent",
  13. runtimeConfig: {
  14. // Private config that is only available on the server
  15. env: "",
  16. apiBaseUrl: "",
  17. // Config within public will be also exposed to the client
  18. public: {
  19. env: "",
  20. apiBaseUrl: "",
  21. },
  22. },
  23. hooks: {
  24. "builder:watch": console.log,
  25. },
  26. app: {
  27. head: {
  28. title: "Opentalent",
  29. meta: [
  30. { charset: "utf-8" },
  31. { name: "viewport", content: "width=device-width, initial-scale=1" },
  32. { hid: "description", name: "description", content: "" },
  33. ],
  34. link: [
  35. { rel: "icon", type: "image/x-icon", href: "/favicon.ico" },
  36. {
  37. rel: "stylesheet",
  38. href: "https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;700&display=swap",
  39. },
  40. ],
  41. },
  42. },
  43. typescript: {
  44. strict: true,
  45. },
  46. modules: [
  47. async (options, nuxt) => {
  48. nuxt.hooks.hook(
  49. "vite:extendConfig",
  50. (config) =>
  51. (config.plugins ?? []).push(
  52. vuetify()
  53. //Remplacer par cela quand l'issue https://github.com/vuetifyjs/vuetify-loader/issues/273 sera règlée..
  54. // voir aussi : https://github.com/nuxt/nuxt/issues/15412 et https://github.com/vuetifyjs/vuetify-loader/issues/290
  55. // vuetify({
  56. // styles: { configFile: './assets/css/settings.scss' }
  57. // })
  58. ) as any
  59. );
  60. },
  61. [
  62. "@pinia/nuxt",
  63. {
  64. autoImports: [
  65. // automatically imports `usePinia()`
  66. "defineStore",
  67. // automatically imports `usePinia()` as `usePiniaStore()`
  68. ["defineStore", "definePiniaStore"],
  69. ],
  70. },
  71. ],
  72. "@pinia-orm/nuxt",
  73. "nuxt-lodash",
  74. "@nuxtjs/i18n",
  75. "@nuxt/devtools",
  76. ],
  77. webfontloader: {
  78. google: {
  79. families: ["Barlow:300,400,500,700&display=swap"],
  80. },
  81. },
  82. devtools: {
  83. // @see https://github.com/nuxt/devtools
  84. enabled: false,
  85. },
  86. vite: {
  87. esbuild: {
  88. drop: process.env.DEBUG ? [] : ["console", "debugger"],
  89. },
  90. ssr: {
  91. noExternal: ["vuetify", "nuxt-lodash"],
  92. },
  93. server: {
  94. https: {
  95. key: fs.readFileSync("local.portail_v2.opentalent.fr.key"),
  96. cert: fs.readFileSync("local.portail_v2.opentalent.fr.crt"),
  97. },
  98. //@ts-ignore
  99. port: 443,
  100. hmr: {
  101. protocol: "wss",
  102. port: 24680,
  103. },
  104. },
  105. },
  106. vuetify: {
  107. styles: { configFile: "src/vuetify.scss" },
  108. },
  109. i18n: {
  110. langDir: "lang",
  111. lazy: true,
  112. locales: [
  113. {
  114. code: "fr",
  115. iso: "fr-FR",
  116. file: "fr.json",
  117. name: "Français",
  118. },
  119. ],
  120. defaultLocale: "fr",
  121. detectBrowserLanguage: false,
  122. vueI18n: {
  123. legacy: false,
  124. datetimeFormats: {
  125. "fr-FR": {
  126. short: {
  127. year: "numeric",
  128. month: "numeric",
  129. day: "numeric",
  130. },
  131. long: {
  132. year: "numeric",
  133. month: "numeric",
  134. day: "numeric",
  135. hour: "numeric",
  136. minute: "numeric",
  137. },
  138. },
  139. },
  140. },
  141. } as NuxtI18nOptions,
  142. build: {
  143. transpile: ["vuetify"],
  144. },
  145. });