nuxt.config.ts 5.1 KB

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