| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- import fs from 'fs'
- import vuetify from 'vite-plugin-vuetify'
- let https = {}
- const transpile = [
- 'vuetify',
- '@vuepic/vue-datepicker',
- 'pinia',
- 'pinia-orm',
- 'date-fns',
- ]
- if (!process.env.NUXT_ENV) {
- throw new Error('Missing environment file - Run yarn install')
- }
- if (process.env.NUXT_ENV === 'dev') {
- https = {
- key: fs.readFileSync('env/local.app.opentalent.fr.key'),
- cert: fs.readFileSync('env/local.app.opentalent.fr.crt'),
- }
- } else {
- transpile.push('lodash')
- }
- /**
- * Nuxt configuration
- *
- * @see https://nuxt.com/docs/api/configuration/nuxt-config
- */
- export default defineNuxtConfig({
- ssr: true,
- experimental: {
- // Fix the 'Cannot stringify non POJO' bug
- // @see https://github.com/nuxt/nuxt/issues/20787
- renderJsonPayloads: false,
- },
- runtimeConfig: {
- // Private config that is only available on the server
- env: '',
- baseUrl: '',
- baseUrlLegacy: '',
- baseUrlAdminLegacy: '',
- baseUrlTypo3: '',
- baseUrlMercure: '',
- fileStorageBaseUrl: '',
- supportUrl: '',
- // Config within public will be also exposed to the client
- public: {
- env: '',
- baseUrl: '',
- baseUrlLegacy: '',
- baseUrlAdminLegacy: '',
- baseUrlTypo3: '',
- baseUrlMercure: '',
- fileStorageBaseUrl: '',
- supportUrl: '',
- },
- },
- hooks: {
- 'builder:watch': console.log,
- },
- app: {
- head: {
- title: 'Opentalent',
- meta: [
- { charset: 'utf-8' },
- { name: 'viewport', content: 'width=device-width, initial-scale=1' },
- { name: 'msapplication-TileColor', content: '#324250' },
- {
- name: 'msapplication-TileImage',
- content: '/favicon/favicon-144x144.png',
- },
- ],
- link: [
- { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
- {
- rel: 'apple-touch-icon-precomposed',
- sizes: '57x57',
- href: '/favicon/apple-touch-icon-57x57.png',
- },
- {
- rel: 'apple-touch-icon-precomposed',
- sizes: '114x114',
- href: '/favicon/apple-touch-icon-114x114.png',
- },
- {
- rel: 'apple-touch-icon-precomposed',
- sizes: '72x72',
- href: '/favicon/apple-touch-icon-72x72.png',
- },
- {
- rel: 'apple-touch-icon-precomposed',
- sizes: '144x144',
- href: '/favicon/apple-touch-icon-144x144.png',
- },
- {
- rel: 'apple-touch-icon-precomposed',
- sizes: '120x120',
- href: '/favicon/apple-touch-icon-120x120.png',
- },
- {
- rel: 'apple-touch-icon-precomposed',
- sizes: '152x152',
- href: '/favicon/apple-touch-icon-152x152.png',
- },
- {
- rel: 'icon',
- sizes: '32x32',
- type: 'image/x-icon',
- href: '/favicon/favicon-32x32.png',
- },
- {
- rel: 'icon',
- sizes: '16x16',
- type: 'image/x-icon',
- href: '/favicon/favicon-16x16.png',
- },
- ],
- },
- },
- css: [
- '@/assets/css/global.scss',
- '@/assets/css/theme.scss',
- '@/assets/css/import.scss',
- '@vuepic/vue-datepicker/dist/main.css',
- '@/assets/css/vue-date-picker.scss',
- ],
- typescript: {
- strict: true,
- },
- modules: [
- async (_, nuxt) => {
- nuxt.hooks.hook('vite:extendConfig', (config) =>
- // @ts-expect-error A revoir après que les lignes aient été décommentées
- (config.plugins ?? []).push(
- vuetify(),
- // Remplacer par cela quand l'issue https://github.com/vuetifyjs/vuetify-loader/issues/273 sera règlée..
- // voir aussi : https://github.com/nuxt/nuxt/issues/15412 et https://github.com/vuetifyjs/vuetify-loader/issues/290
- // voir aussi : https://github.com/jrutila/nuxt3-vuetify3-bug
- // vuetify({
- // styles: { configFile: './assets/css/settings.scss' }
- // })
- ),
- )
- },
- [
- '@pinia/nuxt',
- {
- autoImports: [
- // automatically imports `usePinia()`
- 'defineStore',
- // automatically imports `usePinia()` as `usePiniaStore()`
- ['defineStore', 'definePiniaStore'],
- ],
- },
- ],
- '@pinia-orm/nuxt',
- '@nuxtjs/i18n',
- '@nuxt/devtools',
- '@nuxt/image',
- 'nuxt-prepare',
- 'nuxt-vitalizer',
- '@nuxt/eslint'
- ],
- vite: {
- esbuild: {
- drop: process.env.DEBUG ? [] : ['console', 'debugger'],
- tsconfigRaw: {
- compilerOptions: {
- experimentalDecorators: true
- }
- }
- },
- ssr: {
- // with ssr enabled, this config is required to load vuetify properly
- noExternal: ['vuetify'],
- },
- server: {
- https,
- // @ts-expect-error J'ignore pourquoi cette erreur TS se produit, cette propriété est valide
- port: 443,
- hmr: {
- protocol: 'wss',
- port: 24678
- }
- }
- },
- // Hide the sourcemaps warnings with vuetify
- // @see https://github.com/vuetifyjs/vuetify-loader/issues/290#issuecomment-1435702713
- sourcemap: {
- server: false,
- client: false
- },
- i18n: {
- langDir: 'lang',
- lazy: true,
- strategy: 'no_prefix',
- locales: [
- {
- code: 'en',
- iso: 'en-US',
- file: 'en.json',
- name: 'English',
- },
- {
- code: 'fr',
- iso: 'fr-FR',
- file: 'fr.json',
- name: 'Français',
- },
- ],
- defaultLocale: 'fr',
- detectBrowserLanguage: false,
- vueI18n: './i18n.config.ts',
- },
- image: {
- provider: 'none',
- },
- build: {
- transpile,
- },
- ignore: [process.env.NUXT_ENV === 'prod' ? 'pages/dev/*' : ''],
- prepare: {
- scripts: ['prepare/buildIndex.ts'],
- },
- compatibilityDate: '2025-03-10',
- })
|