| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- import fs from "fs";
- import vuetify from "vite-plugin-vuetify";
- import type { NuxtI18nOptions } from "@nuxtjs/i18n";
- let https = {}
- let transpile = ['vuetify', 'pinia', 'pinia-orm', 'date-fns']
- if (!process.env.NUXT_ENV) {
- throw Error('Missing environment file - Run yarn install')
- }
- if (process.env.NUXT_ENV === 'dev') {
- https = {
- key: fs.readFileSync('env/local.portail_v2.opentalent.fr.key'),
- cert: fs.readFileSync('env/local.portail_v2.opentalent.fr.crt'),
- }
- } else {
- transpile.push('lodash')
- }
- /**
- * Nuxt configuration
- *
- * @see https://nuxt.com/docs/api/configuration/nuxt-config
- */
- export default defineNuxtConfig({
- ssr: false,
- title: "Opentalent",
- runtimeConfig: {
- // Private config that is only available on the server
- env: "",
- apiBaseUrl: "",
- agendaBaseUrl: "",
- hCaptchaSiteKey: "35360874-ebb1-4748-86e3-9b156d5bfc53",
- // Config within public will be also exposed to the client
- public: {
- env: "",
- apiBaseUrl: "",
- agendaBaseUrl: "",
- hCaptchaSiteKey: "35360874-ebb1-4748-86e3-9b156d5bfc53",
- },
- },
- css: [
- "~/assets/style/main.scss",
- "~/assets/style/theme.scss",
- ],
- hooks: {
- "builder:watch": console.log,
- },
- app: {
- head: {
- title: "Opentalent",
- meta: [
- { charset: "utf-8" },
- { name: "viewport", content: "width=device-width, initial-scale=1" },
- { hid: "description", name: "description", content: "" },
- ],
- link: [
- { rel: "icon", type: "image/x-icon", href: "/favicon.ico" },
- {
- rel: "stylesheet",
- href: "https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;700&display=swap",
- },
- ],
- },
- },
- typescript: {
- strict: true,
- },
- modules: [
- async (options, nuxt) => {
- nuxt.hooks.hook(
- "vite:extendConfig",
- (config) =>
- (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
- // vuetify({
- // styles: { configFile: './assets/css/settings.scss' }
- // })
- ) as any
- );
- },
- [
- "@pinia/nuxt",
- {
- autoImports: [
- // automatically imports `usePinia()`
- "defineStore",
- // automatically imports `usePinia()` as `usePiniaStore()`
- ["defineStore", "definePiniaStore"],
- ],
- },
- ],
- "@pinia-orm/nuxt",
- "nuxt-lodash",
- "@nuxtjs/i18n",
- "@nuxt/devtools",
- 'nuxt3-leaflet'
- ],
- router: {
- options: {
- scrollBehaviorType: 'smooth'
- }
- },
- webfontloader: {
- google: {
- families: ["Barlow:300,400,500,700&display=swap"],
- },
- },
- devtools: {
- // @see https://github.com/nuxt/devtools
- enabled: true,
- },
- vite: {
- esbuild: {
- drop: process.env.DEBUG ? [] : ["console", "debugger"],
- tsconfigRaw: {
- compilerOptions: {
- experimentalDecorators: true,
- }
- }
- },
- ssr: {
- noExternal: ["vuetify"],
- },
- server: {
- https,
- //@ts-ignore
- port: 443,
- hmr: {
- protocol: "wss",
- port: 24680
- },
- },
- },
- vuetify: {
- styles: { configFile: "src/vuetify.scss" },
- },
- i18n: {
- langDir: "lang",
- lazy: true,
- locales: [
- {
- code: "fr",
- iso: "fr-FR",
- file: "fr.json",
- name: "Français",
- },
- ],
- defaultLocale: "fr",
- detectBrowserLanguage: false,
- } as NuxtI18nOptions,
- build: {
- transpile: transpile,
- },
- });
|