nuxt.config.ts 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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: true,
  11. title: 'Opentalent',
  12. runtimeConfig: {
  13. // Private config that is only available on the server
  14. env: '',
  15. baseUrl: '',
  16. baseUrlLegacy: '',
  17. baseUrlAdminLegacy: '',
  18. baseUrlTypo3: '',
  19. baseUrlMercure: '',
  20. supportUrl: '',
  21. // Config within public will be also exposed to the client
  22. public: {
  23. env: '',
  24. baseUrl: '',
  25. baseUrlLegacy: '',
  26. baseUrlAdminLegacy: '',
  27. baseUrlTypo3: '',
  28. baseUrlMercure: '',
  29. supportUrl: '',
  30. school_product: 'school',
  31. school_premium_product: 'school-premium',
  32. artist_product: 'artist',
  33. artist_premium_product: 'artist-premium',
  34. manager_product: 'manager',
  35. cmf_network: 'CMF',
  36. ffec_network: 'FFEC',
  37. OPENTALENT_MANAGER_ID: 93931,
  38. CMF_ID: 12097
  39. }
  40. },
  41. hooks: {
  42. 'builder:watch': console.log
  43. },
  44. app: {
  45. head: {
  46. title: 'Opentalent',
  47. meta: [
  48. { charset: 'utf-8' },
  49. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  50. { name: 'msapplication-TileColor', content: '#324250' },
  51. { name: 'msapplication-TileImage', content: '/favicon/mstile-144x144.png' }
  52. ],
  53. link: [
  54. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  55. { rel: 'apple-touch-icon-precomposed', sizes: '57x57', href: '/favicon/apple-touch-icon-57x57.png' },
  56. { rel: 'apple-touch-icon-precomposed', sizes: '114x114', href: '/favicon/apple-touch-icon-114x114.png' },
  57. { rel: 'apple-touch-icon-precomposed', sizes: '72x72', href: '/favicon/apple-touch-icon-72x72.png' },
  58. { rel: 'apple-touch-icon-precomposed', sizes: '144x144', href: '/favicon/apple-touch-icon-144x144.png' },
  59. { rel: 'apple-touch-icon-precomposed', sizes: '120x120', href: '/favicon/apple-touch-icon-120x120.png' },
  60. { rel: 'apple-touch-icon-precomposed', sizes: '152x152', href: '/favicon/apple-touch-icon-152x152.png' },
  61. { rel: 'icon', sizes: '32x32', type: 'image/x-icon', href: '/favicon/favicon-32x32.png' },
  62. { rel: 'icon', sizes: '16x16', type: 'image/x-icon', href: '/favicon/favicon-16x16.png' },
  63. ]
  64. }
  65. },
  66. css: [
  67. '@/assets/css/global.scss',
  68. '@/assets/css/import.scss'
  69. ],
  70. typescript: {
  71. strict: true
  72. },
  73. modules: [
  74. async (options, nuxt) => {
  75. nuxt.hooks.hook('vite:extendConfig', config => (config.plugins ?? []).push(
  76. vuetify()
  77. //Remplacer par cela quand l'issue https://github.com/vuetifyjs/vuetify-loader/issues/273 sera règlée..
  78. // voir aussi : https://github.com/nuxt/nuxt/issues/15412 et https://github.com/vuetifyjs/vuetify-loader/issues/290
  79. // vuetify({
  80. // styles: { configFile: './assets/css/settings.scss' }
  81. // })
  82. ) as any );
  83. },
  84. [
  85. '@pinia/nuxt',
  86. {
  87. autoImports: [
  88. // automatically imports `usePinia()`
  89. 'defineStore',
  90. // automatically imports `usePinia()` as `usePiniaStore()`
  91. ['defineStore', 'definePiniaStore'],
  92. ],
  93. }
  94. ],
  95. '@pinia-orm/nuxt',
  96. 'nuxt-lodash',
  97. '@nuxtjs/i18n',
  98. '@nuxt/image-edge'
  99. ],
  100. vite: {
  101. esbuild: {
  102. drop: process.env.DEBUG ? [] : ['console', 'debugger'],
  103. },
  104. ssr: {
  105. noExternal: ['vuetify', 'nuxt-lodash']
  106. },
  107. server : {
  108. https: {
  109. key: fs.readFileSync('local.app-v3.opentalent.fr.key'),
  110. cert: fs.readFileSync('local.app-v3.opentalent.fr.crt'),
  111. },
  112. //@ts-ignore
  113. port: 443,
  114. hmr: {
  115. protocol: 'wss',
  116. port: 24678
  117. }
  118. },
  119. },
  120. i18n: {
  121. langDir: 'lang',
  122. lazy: true,
  123. locales: [
  124. {
  125. code: 'en',
  126. iso: 'en-US',
  127. file: 'en.json',
  128. name: 'English'
  129. },
  130. {
  131. code: 'fr',
  132. iso: 'fr-FR',
  133. file: 'fr.json',
  134. name: 'Français'
  135. }
  136. ],
  137. defaultLocale: 'fr',
  138. fallbackLocale: 'en',
  139. detectBrowserLanguage: false,
  140. vueI18n: {
  141. legacy: false,
  142. datetimeFormats: {
  143. 'fr-FR': {
  144. short: {
  145. year: 'numeric', month: 'numeric', day: 'numeric'
  146. },
  147. long: {
  148. year: 'numeric', month: 'numeric', day: 'numeric',
  149. hour: 'numeric', minute: 'numeric'
  150. }
  151. },
  152. 'en': {
  153. short: {
  154. year: 'numeric', month: 'numeric', day: 'numeric'
  155. },
  156. long: {
  157. year: 'numeric', month: 'numeric', day: 'numeric',
  158. hour: 'numeric', minute: 'numeric'
  159. }
  160. }
  161. }
  162. },
  163. } as NuxtI18nOptions,
  164. build: {
  165. transpile: ['vuetify'],
  166. },
  167. })