nuxt.config.ts 4.7 KB

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