nuxt.config.ts 5.9 KB

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