nuxt.config.ts 2.5 KB

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