nuxt.config.ts 3.5 KB

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