nuxt.config.ts 5.9 KB

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