nuxt.config.ts 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. build: {
  25. transpile: ['vuetify'],
  26. },
  27. hooks: {
  28. 'builder:watch': console.log,
  29. },
  30. modules: [
  31. async (_, nuxt) => {
  32. nuxt.hooks.hook('vite:extendConfig', (config) =>
  33. // @ts-expect-error A revoir après que les lignes aient été décommentées
  34. (config.plugins ?? []).push(
  35. vuetify()
  36. // Remplacer par cela quand l'issue https://github.com/vuetifyjs/vuetify-loader/issues/273 sera règlée..
  37. // voir aussi : https://github.com/nuxt/nuxt/issues/15412 et https://github.com/vuetifyjs/vuetify-loader/issues/290
  38. // voir aussi : https://github.com/jrutila/nuxt3-vuetify3-bug
  39. // vuetify({
  40. // styles: { configFile: './assets/css/settings.scss' }
  41. // })
  42. )
  43. )
  44. },
  45. 'nuxt-lodash',
  46. '@nuxt/devtools',
  47. '@nuxtjs/sitemap',
  48. '@nuxtjs/i18n',
  49. '@nuxtjs/google-fonts',
  50. '@pinia/nuxt',
  51. ],
  52. vite: {
  53. esbuild: {
  54. drop: process.env.DEBUG ? [] : ['console', 'debugger'],
  55. tsconfigRaw: {
  56. compilerOptions: {
  57. experimentalDecorators: true,
  58. },
  59. },
  60. },
  61. ssr: {
  62. noExternal: ['vuetify'],
  63. },
  64. vue: {
  65. template: {
  66. transformAssetUrls,
  67. },
  68. },
  69. },
  70. router: {
  71. options: {
  72. scrollBehaviorType: 'smooth',
  73. },
  74. },
  75. site: {
  76. url: 'https://cv.ogene.fr'
  77. },
  78. i18n: {
  79. langDir: 'lang',
  80. lazy: true,
  81. locales: [
  82. {
  83. code: 'en',
  84. iso: 'en-US',
  85. file: 'en.json',
  86. name: 'English',
  87. },
  88. {
  89. code: 'fr',
  90. iso: 'fr-FR',
  91. file: 'fr.json',
  92. name: 'Français',
  93. },
  94. ],
  95. compilation: {
  96. strictMessage: false,
  97. },
  98. defaultLocale: 'fr',
  99. //@ts-ignore
  100. detectBrowserLanguage: true,
  101. },
  102. googleFonts: {
  103. families: {
  104. Inter: true,
  105. },
  106. },
  107. compatibilityDate: '2024-07-02',
  108. })