nuxt.config.ts 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. runtimeConfig: {
  12. // Private config that is only available on the server
  13. env: '',
  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. env: '',
  23. baseUrl: '',
  24. baseUrlLegacy: '',
  25. baseUrlAdminLegacy: '',
  26. baseUrlTypo3: '',
  27. baseUrlMercure: '',
  28. supportUrl: '',
  29. school_product: 'school',
  30. school_premium_product: 'school-premium',
  31. artist_product: 'artist',
  32. artist_premium_product: 'artist-premium',
  33. manager_product: 'manager',
  34. cmf_network: 'CMF',
  35. ffec_network: 'FFEC',
  36. OPENTALENT_MANAGER_ID: 93931,
  37. CMF_ID: 12097
  38. }
  39. },
  40. hooks: {
  41. 'builder:watch': console.log
  42. },
  43. app: {
  44. head: {
  45. title: 'Opentalent',
  46. meta: [
  47. { charset: 'utf-8' },
  48. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  49. { name: 'msapplication-TileColor', content: '#324250' },
  50. { name: 'msapplication-TileImage', content: '/favicon/mstile-144x144.png' }
  51. ],
  52. link: [
  53. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  54. { rel: 'apple-touch-icon-precomposed', sizes: '57x57', href: '/favicon/apple-touch-icon-57x57.png' },
  55. { rel: 'apple-touch-icon-precomposed', sizes: '114x114', href: '/favicon/apple-touch-icon-114x114.png' },
  56. { rel: 'apple-touch-icon-precomposed', sizes: '72x72', href: '/favicon/apple-touch-icon-72x72.png' },
  57. { rel: 'apple-touch-icon-precomposed', sizes: '144x144', href: '/favicon/apple-touch-icon-144x144.png' },
  58. { rel: 'apple-touch-icon-precomposed', sizes: '120x120', href: '/favicon/apple-touch-icon-120x120.png' },
  59. { rel: 'apple-touch-icon-precomposed', sizes: '152x152', href: '/favicon/apple-touch-icon-152x152.png' },
  60. { rel: 'icon', sizes: '32x32', type: 'image/x-icon', href: '/favicon/favicon-32x32.png' },
  61. { rel: 'icon', sizes: '16x16', type: 'image/x-icon', href: '/favicon/favicon-16x16.png' },
  62. ]
  63. }
  64. },
  65. css: [
  66. '@/assets/css/global.scss',
  67. '@/assets/css/theme.scss',
  68. '@/assets/css/import.scss',
  69. '@vuepic/vue-datepicker/dist/main.css'
  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. '@nuxtjs/i18n',
  98. '@nuxt/image-edge',
  99. '@nuxt/devtools'
  100. ],
  101. vite: {
  102. esbuild: {
  103. drop: process.env.DEBUG ? [] : ['console', 'debugger'],
  104. },
  105. ssr: {
  106. noExternal: ['vuetify']
  107. },
  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': {
  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', '@vuepic/vue-datepicker'],
  167. },
  168. })