nuxt.config.ts 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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. '@nuxt/image-edge',
  85. ],
  86. typescript: {
  87. strict: true
  88. },
  89. //@ts-ignore
  90. i18n: {
  91. langDir: 'lang',
  92. lazy: true,
  93. locales: [
  94. {
  95. code: 'en',
  96. iso: 'en-US',
  97. file: 'en.json',
  98. name: 'English'
  99. },
  100. {
  101. code: 'fr',
  102. iso: 'fr-FR',
  103. file: 'fr.json',
  104. name: 'Français'
  105. }
  106. ],
  107. defaultLocale: 'fr',
  108. fallbackLocale: 'en',
  109. detectBrowserLanguage: false,
  110. vueI18n: {
  111. legacy: false,
  112. datetimeFormats: {
  113. 'fr-FR': {
  114. short: {
  115. year: 'numeric', month: 'numeric', day: 'numeric'
  116. },
  117. long: {
  118. year: 'numeric', month: 'numeric', day: 'numeric',
  119. hour: 'numeric', minute: 'numeric'
  120. }
  121. },
  122. 'en': {
  123. short: {
  124. year: 'numeric', month: 'numeric', day: 'numeric'
  125. },
  126. long: {
  127. year: 'numeric', month: 'numeric', day: 'numeric',
  128. hour: 'numeric', minute: 'numeric'
  129. }
  130. }
  131. }
  132. },
  133. } as I18nOptions,
  134. build: {
  135. transpile: ['vuetify'],
  136. },
  137. vite: {
  138. define: {
  139. 'process.env.DEBUG': process.env.DEBUG,
  140. },
  141. //@ts-ignore
  142. server : {
  143. https: {
  144. key: fs.readFileSync('local.app-v3.opentalent.fr.key'),
  145. cert: fs.readFileSync('local.app-v3.opentalent.fr.crt'),
  146. },
  147. //@ts-ignore
  148. port: 443,
  149. hmr: {
  150. protocol: 'wss'
  151. }
  152. },
  153. ssr: { noExternal: ["moment"], }
  154. }
  155. })