nuxt.config.ts 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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. baseUrl: '',
  15. baseUrlLegacy: '',
  16. baseUrlAdminLegacy: '',
  17. baseUrlTypo3: '',
  18. baseUrlMercure: '',
  19. supportUrl: '',
  20. // Config within public will be also exposed to the client
  21. public: {
  22. baseUrl: '',
  23. baseUrlLegacy: '',
  24. baseUrlAdminLegacy: '',
  25. baseUrlTypo3: '',
  26. baseUrlMercure: '',
  27. supportUrl: '',
  28. school_product: 'school',
  29. school_premium_product: 'school-premium',
  30. artist_product: 'artist',
  31. artist_premium_product: 'artist-premium',
  32. manager_product: 'manager',
  33. cmf_network: 'CMF',
  34. ffec_network: 'FFEC',
  35. OPENTALENT_MANAGER_ID: 93931,
  36. CMF_ID: 12097
  37. }
  38. },
  39. env: {
  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. { hid: 'description', name: 'description', content: '' },
  51. { name: 'msapplication-TileColor', content: '#324250' },
  52. { name: 'msapplication-TileImage', content: '/favicon/mstile-144x144.png' }
  53. ],
  54. link: [
  55. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  56. { rel: 'apple-touch-icon-precomposed', sizes: '57x57', href: '/favicon/apple-touch-icon-57x57.png' },
  57. { rel: 'apple-touch-icon-precomposed', sizes: '114x114', href: '/favicon/apple-touch-icon-114x114.png' },
  58. { rel: 'apple-touch-icon-precomposed', sizes: '72x72', href: '/favicon/apple-touch-icon-72x72.png' },
  59. { rel: 'apple-touch-icon-precomposed', sizes: '144x144', href: '/favicon/apple-touch-icon-144x144.png' },
  60. { rel: 'apple-touch-icon-precomposed', sizes: '120x120', href: '/favicon/apple-touch-icon-120x120.png' },
  61. { rel: 'apple-touch-icon-precomposed', sizes: '152x152', href: '/favicon/apple-touch-icon-152x152.png' },
  62. { rel: 'icon', sizes: '32x32', type: 'image/x-icon', href: '/favicon/favicon-32x32.png' },
  63. { rel: 'icon', sizes: '16x16', type: 'image/x-icon', href: '/favicon/favicon-16x16.png' },
  64. ]
  65. }
  66. },
  67. css: [
  68. '@/assets/css/global.scss',
  69. '@/assets/css/import.scss'
  70. ],
  71. typescript: {
  72. strict: true
  73. },
  74. modules: [
  75. async (options, nuxt) => {
  76. nuxt.hooks.hook('vite:extendConfig', config => (config.plugins ?? []).push(
  77. vuetify()
  78. //Remplacer par cela quand l'issue https://github.com/vuetifyjs/vuetify-loader/issues/273 sera règlée..
  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. //@ts-ignore
  108. server : {
  109. https: {
  110. key: fs.readFileSync('local.app-v3.opentalent.fr.key'),
  111. cert: fs.readFileSync('local.app-v3.opentalent.fr.crt'),
  112. },
  113. //@ts-ignore
  114. port: 443,
  115. hmr: {
  116. protocol: 'wss',
  117. port: 24678
  118. }
  119. },
  120. },
  121. i18n: {
  122. langDir: 'lang',
  123. lazy: true,
  124. locales: [
  125. {
  126. code: 'en',
  127. iso: 'en-US',
  128. file: 'en.json',
  129. name: 'English'
  130. },
  131. {
  132. code: 'fr',
  133. iso: 'fr-FR',
  134. file: 'fr.json',
  135. name: 'Français'
  136. }
  137. ],
  138. defaultLocale: 'fr',
  139. fallbackLocale: 'en',
  140. detectBrowserLanguage: false,
  141. vueI18n: {
  142. legacy: false,
  143. datetimeFormats: {
  144. 'fr-FR': {
  145. short: {
  146. year: 'numeric', month: 'numeric', day: 'numeric'
  147. },
  148. long: {
  149. year: 'numeric', month: 'numeric', day: 'numeric',
  150. hour: 'numeric', minute: 'numeric'
  151. }
  152. },
  153. 'en': {
  154. short: {
  155. year: 'numeric', month: 'numeric', day: 'numeric'
  156. },
  157. long: {
  158. year: 'numeric', month: 'numeric', day: 'numeric',
  159. hour: 'numeric', minute: 'numeric'
  160. }
  161. }
  162. }
  163. },
  164. } as NuxtI18nOptions,
  165. build: {
  166. transpile: ['vuetify'],
  167. },
  168. //@ts-ignore
  169. vite: {
  170. define: {
  171. 'process.env.DEBUG': process.env.DEBUG,
  172. },
  173. //@ts-ignore
  174. server : {
  175. https: {
  176. key: fs.readFileSync('local.app-v3.opentalent.fr.key'),
  177. cert: fs.readFileSync('local.app-v3.opentalent.fr.crt'),
  178. },
  179. //@ts-ignore
  180. port: 443,
  181. hmr: {
  182. protocol: 'wss'
  183. }
  184. },
  185. ssr: { noExternal: ["moment"], }
  186. }
  187. })