nuxt.config.ts 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. import fs from 'fs';
  2. import type { I18nOptions } from 'vue-i18n'
  3. // https://v3.nuxtjs.org/api/configuration/nuxt.config
  4. export default defineNuxtConfig({
  5. vuetify: {
  6. customVariables: ['~/assets/css/variables.scss'],
  7. treeShake: false,
  8. },
  9. css: [
  10. '@/assets/css/global.css',
  11. '@/assets/css/import.css',
  12. 'vuetify/lib/styles/main.sass'
  13. ],
  14. runtimeConfig: {
  15. // Private config that is only available on the server
  16. baseUrl: '',
  17. baseUrlLegacy: '',
  18. baseUrlAdminLegacy: '',
  19. baseUrlTypo3: '',
  20. baseUrlMercure: '',
  21. supportUrl: '',
  22. // Config within public will be also exposed to the client
  23. public: {
  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. env: {
  42. },
  43. hooks: {
  44. 'builder:watch': console.log
  45. },
  46. app: {
  47. head: {
  48. title: 'Opentalent',
  49. meta: [
  50. { charset: 'utf-8' },
  51. { name: 'viewport', content: 'width=device-width, initial-scale=1' },
  52. { hid: 'description', name: 'description', content: '' },
  53. { name: 'msapplication-TileColor', content: '#324250' },
  54. { name: 'msapplication-TileImage', content: '/favicon/mstile-144x144.png' }
  55. ],
  56. link: [
  57. { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
  58. { rel: 'apple-touch-icon-precomposed', sizes: '57x57', href: '/favicon/apple-touch-icon-57x57.png' },
  59. { rel: 'apple-touch-icon-precomposed', sizes: '114x114', href: '/favicon/apple-touch-icon-114x114.png' },
  60. { rel: 'apple-touch-icon-precomposed', sizes: '72x72', href: '/favicon/apple-touch-icon-72x72.png' },
  61. { rel: 'apple-touch-icon-precomposed', sizes: '144x144', href: '/favicon/apple-touch-icon-144x144.png' },
  62. { rel: 'apple-touch-icon-precomposed', sizes: '120x120', href: '/favicon/apple-touch-icon-120x120.png' },
  63. { rel: 'apple-touch-icon-precomposed', sizes: '152x152', href: '/favicon/apple-touch-icon-152x152.png' },
  64. { rel: 'icon', sizes: '32x32', type: 'image/x-icon', href: '/favicon/favicon-32x32.png' },
  65. { rel: 'icon', sizes: '16x16', type: 'image/x-icon', href: '/favicon/favicon-16x16.png' },
  66. ]
  67. }
  68. },
  69. modules: [
  70. [
  71. '@pinia/nuxt',
  72. {
  73. autoImports: [
  74. // automatically imports `usePinia()`
  75. 'defineStore',
  76. // automatically imports `usePinia()` as `usePiniaStore()`
  77. ['defineStore', 'definePiniaStore'],
  78. ],
  79. }
  80. ],
  81. '@pinia-orm/nuxt',
  82. 'nuxt-lodash',
  83. '@nuxtjs/i18n',
  84. ],
  85. typescript: {
  86. strict: true
  87. },
  88. //@ts-ignore
  89. i18n: {
  90. langDir: 'lang',
  91. lazy: true,
  92. locales: [
  93. {
  94. code: 'en',
  95. iso: 'en-US',
  96. file: 'en.json',
  97. name: 'English'
  98. },
  99. {
  100. code: 'fr',
  101. iso: 'fr-FR',
  102. file: 'fr.json',
  103. name: 'Français'
  104. }
  105. ],
  106. defaultLocale: 'fr',
  107. fallbackLocale: 'en',
  108. detectBrowserLanguage: false,
  109. vueI18n: {
  110. legacy: false,
  111. datetimeFormats: {
  112. 'fr-FR': {
  113. short: {
  114. year: 'numeric', month: 'numeric', day: 'numeric'
  115. },
  116. long: {
  117. year: 'numeric', month: 'numeric', day: 'numeric',
  118. hour: 'numeric', minute: 'numeric'
  119. }
  120. },
  121. 'en': {
  122. short: {
  123. year: 'numeric', month: 'numeric', day: 'numeric'
  124. },
  125. long: {
  126. year: 'numeric', month: 'numeric', day: 'numeric',
  127. hour: 'numeric', minute: 'numeric'
  128. }
  129. }
  130. }
  131. },
  132. } as I18nOptions,
  133. build: {
  134. transpile: ['vuetify'],
  135. },
  136. vite: {
  137. define: {
  138. 'process.env.DEBUG': process.env.DEBUG,
  139. },
  140. //@ts-ignore
  141. server : {
  142. https: {
  143. key: fs.readFileSync('local.app-v3.opentalent.fr.key'),
  144. cert: fs.readFileSync('local.app-v3.opentalent.fr.crt'),
  145. },
  146. //@ts-ignore
  147. port: 443,
  148. hmr: {
  149. protocol: 'wss'
  150. }
  151. },
  152. ssr: { noExternal: ["moment"], }
  153. }
  154. })