nuxt.config.ts 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  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. // voir aussi : https://github.com/nuxt/nuxt/issues/15412 et https://github.com/vuetifyjs/vuetify-loader/issues/290
  80. // vuetify({
  81. // styles: { configFile: './assets/css/settings.scss' }
  82. // })
  83. ) as any );
  84. },
  85. [
  86. '@pinia/nuxt',
  87. {
  88. autoImports: [
  89. // automatically imports `usePinia()`
  90. 'defineStore',
  91. // automatically imports `usePinia()` as `usePiniaStore()`
  92. ['defineStore', 'definePiniaStore'],
  93. ],
  94. }
  95. ],
  96. '@pinia-orm/nuxt',
  97. 'nuxt-lodash',
  98. '@nuxtjs/i18n',
  99. '@nuxt/image-edge'
  100. ],
  101. vite: {
  102. esbuild: {
  103. drop: process.env.DEBUG ? [] : ['console', 'debugger'],
  104. },
  105. ssr: {
  106. noExternal: ['vuetify', 'nuxt-lodash']
  107. },
  108. //@ts-ignore
  109. server : {
  110. https: {
  111. key: fs.readFileSync('local.app-v3.opentalent.fr.key'),
  112. cert: fs.readFileSync('local.app-v3.opentalent.fr.crt'),
  113. },
  114. //@ts-ignore
  115. port: 443,
  116. hmr: {
  117. protocol: 'wss',
  118. port: 24678
  119. }
  120. },
  121. },
  122. i18n: {
  123. langDir: 'lang',
  124. lazy: true,
  125. locales: [
  126. {
  127. code: 'en',
  128. iso: 'en-US',
  129. file: 'en.json',
  130. name: 'English'
  131. },
  132. {
  133. code: 'fr',
  134. iso: 'fr-FR',
  135. file: 'fr.json',
  136. name: 'Français'
  137. }
  138. ],
  139. defaultLocale: 'fr',
  140. fallbackLocale: 'en',
  141. detectBrowserLanguage: false,
  142. vueI18n: {
  143. legacy: false,
  144. datetimeFormats: {
  145. 'fr-FR': {
  146. short: {
  147. year: 'numeric', month: 'numeric', day: 'numeric'
  148. },
  149. long: {
  150. year: 'numeric', month: 'numeric', day: 'numeric',
  151. hour: 'numeric', minute: 'numeric'
  152. }
  153. },
  154. 'en': {
  155. short: {
  156. year: 'numeric', month: 'numeric', day: 'numeric'
  157. },
  158. long: {
  159. year: 'numeric', month: 'numeric', day: 'numeric',
  160. hour: 'numeric', minute: 'numeric'
  161. }
  162. }
  163. }
  164. },
  165. } as NuxtI18nOptions,
  166. build: {
  167. transpile: ['vuetify'],
  168. },
  169. //@ts-ignore
  170. vite: {
  171. define: {
  172. 'process.env.DEBUG': process.env.DEBUG,
  173. },
  174. //@ts-ignore
  175. server : {
  176. https: {
  177. key: fs.readFileSync('local.app-v3.opentalent.fr.key'),
  178. cert: fs.readFileSync('local.app-v3.opentalent.fr.crt'),
  179. },
  180. //@ts-ignore
  181. port: 443,
  182. hmr: {
  183. protocol: 'wss'
  184. }
  185. },
  186. ssr: { noExternal: ["moment"], }
  187. }
  188. })