nuxt.config.ts 3.2 KB

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