nuxt.config.ts 5.5 KB

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