nuxt.config.ts 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. '@vuepic/vue-datepicker/dist/main.css'
  71. ],
  72. typescript: {
  73. strict: true
  74. },
  75. modules: [
  76. async (options, nuxt) => {
  77. nuxt.hooks.hook('vite:extendConfig', config => (config.plugins ?? []).push(
  78. vuetify()
  79. //Remplacer par cela quand l'issue https://github.com/vuetifyjs/vuetify-loader/issues/273 sera règlée..
  80. // voir aussi : https://github.com/nuxt/nuxt/issues/15412 et https://github.com/vuetifyjs/vuetify-loader/issues/290
  81. // vuetify({
  82. // styles: { configFile: './assets/css/settings.scss' }
  83. // })
  84. ) as any );
  85. },
  86. [
  87. '@pinia/nuxt',
  88. {
  89. autoImports: [
  90. // automatically imports `usePinia()`
  91. 'defineStore',
  92. // automatically imports `usePinia()` as `usePiniaStore()`
  93. ['defineStore', 'definePiniaStore'],
  94. ],
  95. }
  96. ],
  97. '@pinia-orm/nuxt',
  98. 'nuxt-lodash',
  99. '@nuxtjs/i18n',
  100. '@nuxt/image-edge',
  101. '@nuxt/devtools'
  102. ],
  103. devtools: {
  104. // @see https://github.com/nuxt/devtools
  105. enabled: false
  106. },
  107. vite: {
  108. esbuild: {
  109. drop: process.env.DEBUG ? [] : ['console', 'debugger'],
  110. },
  111. ssr: {
  112. noExternal: ['vuetify', 'nuxt-lodash']
  113. },
  114. server : {
  115. https: {
  116. key: fs.readFileSync('local.app-v3.opentalent.fr.key'),
  117. cert: fs.readFileSync('local.app-v3.opentalent.fr.crt'),
  118. },
  119. //@ts-ignore
  120. port: 443,
  121. hmr: {
  122. protocol: 'wss',
  123. port: 24678
  124. }
  125. },
  126. },
  127. vuetify: {
  128. styles: { configFile: 'src/vuetify.scss' }
  129. },
  130. i18n: {
  131. langDir: 'lang',
  132. lazy: true,
  133. locales: [
  134. {
  135. code: 'en',
  136. iso: 'en-US',
  137. file: 'en.json',
  138. name: 'English'
  139. },
  140. {
  141. code: 'fr',
  142. iso: 'fr-FR',
  143. file: 'fr.json',
  144. name: 'Français'
  145. }
  146. ],
  147. defaultLocale: 'fr',
  148. fallbackLocale: 'en',
  149. detectBrowserLanguage: false,
  150. vueI18n: {
  151. legacy: false,
  152. datetimeFormats: {
  153. 'fr': {
  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. 'en': {
  163. short: {
  164. year: 'numeric', month: 'numeric', day: 'numeric'
  165. },
  166. long: {
  167. year: 'numeric', month: 'numeric', day: 'numeric',
  168. hour: 'numeric', minute: 'numeric'
  169. }
  170. }
  171. }
  172. },
  173. } as NuxtI18nOptions,
  174. build: {
  175. transpile: ['vuetify', '@vuepic/vue-datepicker'],
  176. },
  177. })