nuxt.config.ts 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  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. '@nuxt/devtools'
  100. ],
  101. devtools: {
  102. // @see https://github.com/nuxt/devtools
  103. enabled: false
  104. },
  105. vite: {
  106. esbuild: {
  107. drop: process.env.DEBUG ? [] : ['console', 'debugger'],
  108. },
  109. ssr: {
  110. noExternal: ['vuetify', 'nuxt-lodash']
  111. },
  112. server : {
  113. https: {
  114. key: fs.readFileSync('local.app-v3.opentalent.fr.key'),
  115. cert: fs.readFileSync('local.app-v3.opentalent.fr.crt'),
  116. },
  117. //@ts-ignore
  118. port: 443,
  119. hmr: {
  120. protocol: 'wss',
  121. port: 24678
  122. }
  123. },
  124. },
  125. i18n: {
  126. langDir: 'lang',
  127. lazy: true,
  128. locales: [
  129. {
  130. code: 'en',
  131. iso: 'en-US',
  132. file: 'en.json',
  133. name: 'English'
  134. },
  135. {
  136. code: 'fr',
  137. iso: 'fr-FR',
  138. file: 'fr.json',
  139. name: 'Français'
  140. }
  141. ],
  142. defaultLocale: 'fr',
  143. fallbackLocale: 'en',
  144. detectBrowserLanguage: false,
  145. vueI18n: {
  146. legacy: false,
  147. datetimeFormats: {
  148. 'fr-FR': {
  149. short: {
  150. year: 'numeric', month: 'numeric', day: 'numeric'
  151. },
  152. long: {
  153. year: 'numeric', month: 'numeric', day: 'numeric',
  154. hour: 'numeric', minute: 'numeric'
  155. }
  156. },
  157. 'en': {
  158. short: {
  159. year: 'numeric', month: 'numeric', day: 'numeric'
  160. },
  161. long: {
  162. year: 'numeric', month: 'numeric', day: 'numeric',
  163. hour: 'numeric', minute: 'numeric'
  164. }
  165. }
  166. }
  167. },
  168. } as NuxtI18nOptions,
  169. build: {
  170. transpile: ['vuetify'],
  171. },
  172. })