nuxt.config.ts 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
  2. export default defineNuxtConfig({
  3. ssr: true,
  4. title: 'La Sauvagerie - Location de vacances',
  5. devtools: {
  6. // @see https://github.com/nuxt/devtools
  7. enabled: true,
  8. },
  9. app: {
  10. head: {
  11. title: 'La Sauvagerie - Location de vacances',
  12. meta: [
  13. { charset: 'utf-8' },
  14. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  15. ],
  16. link: [
  17. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  18. ],
  19. htmlAttrs: {
  20. lang: 'fr-FR'
  21. }
  22. },
  23. },
  24. runtimeConfig: {
  25. challengeUrl: 'https://api.ogene.fr/api/challenge',
  26. public: {
  27. challengeUrl: 'https://api.ogene.fr/api/challenge'
  28. }
  29. },
  30. build: {
  31. transpile: ['vuetify'],
  32. },
  33. hooks: {
  34. 'builder:watch': console.log,
  35. },
  36. modules: [
  37. async (_, nuxt) => {
  38. nuxt.hooks.hook('vite:extendConfig', (config) =>
  39. // @ts-expect-error A revoir après que les lignes aient été décommentées
  40. (config.plugins ?? []).push(
  41. vuetify()
  42. // Remplacer par cela quand l'issue https://github.com/vuetifyjs/vuetify-loader/issues/273 sera règlée..
  43. // voir aussi : https://github.com/nuxt/nuxt/issues/15412 et https://github.com/vuetifyjs/vuetify-loader/issues/290
  44. // voir aussi : https://github.com/jrutila/nuxt3-vuetify3-bug
  45. // vuetify({
  46. // styles: { configFile: './assets/css/settings.scss' }
  47. // })
  48. )
  49. )
  50. },
  51. 'nuxt-lodash',
  52. '@nuxt/devtools',
  53. '@nuxtjs/sitemap',
  54. [
  55. '@nuxtjs/i18n',
  56. {
  57. vueI18n: './i18n/i18n.config.ts'
  58. }
  59. ],
  60. '@nuxtjs/google-fonts',
  61. '@pinia/nuxt',
  62. ],
  63. vite: {
  64. esbuild: {
  65. drop: process.env.DEBUG ? [] : ['console', 'debugger'],
  66. tsconfigRaw: {
  67. compilerOptions: {
  68. experimentalDecorators: true,
  69. },
  70. },
  71. },
  72. ssr: {
  73. noExternal: ['vuetify'],
  74. },
  75. vue: {
  76. template: {
  77. transformAssetUrls,
  78. },
  79. },
  80. },
  81. i18n: {
  82. langDir: 'lang',
  83. lazy: true,
  84. strategy: 'no_prefix',
  85. locales: [
  86. {
  87. code: 'en',
  88. iso: 'en-US',
  89. file: 'en.json',
  90. name: 'English',
  91. },
  92. {
  93. code: 'fr',
  94. iso: 'fr-FR',
  95. file: 'fr.json',
  96. name: 'Français',
  97. },
  98. ],
  99. defaultLocale: 'fr',
  100. detectBrowserLanguage: false,
  101. vueI18n: './i18n.config.ts',
  102. },
  103. router: {
  104. options: {
  105. scrollBehaviorType: 'smooth',
  106. },
  107. },
  108. site: {
  109. url: 'https://sauvagerie.fr'
  110. },
  111. googleFonts: {
  112. families: {
  113. Inter: true,
  114. },
  115. },
  116. compatibilityDate: '2024-07-02',
  117. })