nuxt.config.ts 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. { rel: 'stylesheet', href: 'https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;700&display=swap' }
  37. ],
  38. },
  39. },
  40. typescript: {
  41. strict: true,
  42. },
  43. modules: [
  44. async (options, nuxt) => {
  45. nuxt.hooks.hook(
  46. "vite:extendConfig",
  47. (config) =>
  48. (config.plugins ?? []).push(
  49. vuetify()
  50. //Remplacer par cela quand l'issue https://github.com/vuetifyjs/vuetify-loader/issues/273 sera règlée..
  51. // voir aussi : https://github.com/nuxt/nuxt/issues/15412 et https://github.com/vuetifyjs/vuetify-loader/issues/290
  52. // vuetify({
  53. // styles: { configFile: './assets/css/settings.scss' }
  54. // })
  55. ) as any
  56. );
  57. },
  58. [
  59. "@pinia/nuxt",
  60. {
  61. autoImports: [
  62. // automatically imports `usePinia()`
  63. "defineStore",
  64. // automatically imports `usePinia()` as `usePiniaStore()`
  65. ["defineStore", "definePiniaStore"],
  66. ],
  67. },
  68. ],
  69. "@pinia-orm/nuxt",
  70. "nuxt-lodash",
  71. "@nuxtjs/i18n",
  72. "@nuxt/devtools",
  73. ],
  74. webfontloader: {
  75. google: {
  76. families: ['Barlow:300,400,500,700&display=swap'],
  77. },
  78. },
  79. devtools: {
  80. // @see https://github.com/nuxt/devtools
  81. enabled: false,
  82. },
  83. vite: {
  84. esbuild: {
  85. drop: process.env.DEBUG ? [] : ["console", "debugger"],
  86. },
  87. ssr: {
  88. noExternal: ["vuetify", "nuxt-lodash"],
  89. },
  90. server: {
  91. https: {
  92. key: fs.readFileSync("local.portail_v2.opentalent.fr.key"),
  93. cert: fs.readFileSync("local.portail_v2.opentalent.fr.crt"),
  94. },
  95. //@ts-ignore
  96. port: 443,
  97. hmr: {
  98. protocol: "wss",
  99. port: 24680,
  100. },
  101. },
  102. },
  103. vuetify: {
  104. styles: { configFile: "src/vuetify.scss" },
  105. },
  106. i18n: {
  107. langDir: "lang",
  108. lazy: true,
  109. locales: [
  110. {
  111. code: "fr",
  112. iso: "fr-FR",
  113. file: "fr.json",
  114. name: "Français",
  115. },
  116. ],
  117. defaultLocale: "fr",
  118. detectBrowserLanguage: false,
  119. vueI18n: {
  120. legacy: false,
  121. datetimeFormats: {
  122. "fr-FR": {
  123. short: {
  124. year: "numeric",
  125. month: "numeric",
  126. day: "numeric",
  127. },
  128. long: {
  129. year: "numeric",
  130. month: "numeric",
  131. day: "numeric",
  132. hour: "numeric",
  133. minute: "numeric",
  134. },
  135. },
  136. },
  137. },
  138. } as NuxtI18nOptions,
  139. build: {
  140. transpile: ["vuetify"],
  141. },
  142. });