nuxt.config.ts 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. import vuetify, { transformAssetUrls } from 'vite-plugin-vuetify'
  2. export default defineNuxtConfig({
  3. ssr: true,
  4. title: 'C.V. Olivier Massot',
  5. devtools: {
  6. // @see https://github.com/nuxt/devtools
  7. enabled: true,
  8. },
  9. app: {
  10. head: {
  11. title: 'C.V. Olivier Massot',
  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: 'en-US'
  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. '@nuxtjs/i18n',
  55. '@nuxtjs/google-fonts',
  56. '@pinia/nuxt',
  57. ],
  58. vite: {
  59. esbuild: {
  60. drop: process.env.DEBUG ? [] : ['console', 'debugger'],
  61. tsconfigRaw: {
  62. compilerOptions: {
  63. experimentalDecorators: true,
  64. },
  65. },
  66. },
  67. ssr: {
  68. noExternal: ['vuetify'],
  69. },
  70. vue: {
  71. template: {
  72. transformAssetUrls,
  73. },
  74. },
  75. },
  76. router: {
  77. options: {
  78. scrollBehaviorType: 'smooth',
  79. },
  80. },
  81. site: {
  82. url: 'https://cv.ogene.fr'
  83. },
  84. i18n: {
  85. langDir: 'lang',
  86. lazy: true,
  87. locales: [
  88. {
  89. code: 'en',
  90. iso: 'en-US',
  91. file: 'en.json',
  92. name: 'English',
  93. },
  94. {
  95. code: 'fr',
  96. iso: 'fr-FR',
  97. file: 'fr.json',
  98. name: 'Français',
  99. },
  100. ],
  101. compilation: {
  102. strictMessage: false,
  103. },
  104. defaultLocale: 'fr',
  105. //@ts-ignore
  106. detectBrowserLanguage: true,
  107. },
  108. googleFonts: {
  109. families: {
  110. Inter: true,
  111. },
  112. },
  113. compatibilityDate: '2024-07-02',
  114. })