2023-10-13 17:39:22 +02:00
|
|
|
import { resolve } from "path";
|
2025-09-25 14:51:43 +02:00
|
|
|
import log from "electron-log/main";
|
2024-01-18 10:18:51 +01:00
|
|
|
import UnzipData from "./electron/UnzipData";
|
|
|
|
|
|
2023-10-13 16:18:44 +02:00
|
|
|
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
|
|
|
export default defineNuxtConfig({
|
2024-01-18 10:18:51 +01:00
|
|
|
hooks: {
|
|
|
|
|
"build:before": () => {
|
2024-01-18 11:54:02 +01:00
|
|
|
if (["typecheck", "postinstall"].filter(action => action === process.env.npm_lifecycle_event).length) {
|
2024-01-18 10:18:51 +01:00
|
|
|
return;
|
|
|
|
|
}
|
2025-09-25 14:51:43 +02:00
|
|
|
log.info("Typecheck and lint OK");
|
2024-01-18 10:18:51 +01:00
|
|
|
}
|
|
|
|
|
},
|
2024-01-04 17:34:13 +01:00
|
|
|
experimental: {
|
|
|
|
|
polyfillVueUseHead: false
|
|
|
|
|
},
|
2024-01-10 18:14:33 +01:00
|
|
|
components: [
|
|
|
|
|
{ path: "~/components", pathPrefix: false }
|
|
|
|
|
],
|
2024-01-11 16:51:31 +01:00
|
|
|
imports: {
|
|
|
|
|
dirs: ["stores", "composables"],
|
|
|
|
|
},
|
2024-01-16 18:15:07 +01:00
|
|
|
// * @pinia/nuxt doit être le dernier dans la liste (source stackoverflow)
|
|
|
|
|
modules: ["nuxt-electron", "@nuxtjs/i18n", "@pinia/nuxt"],
|
2024-01-04 15:38:50 +01:00
|
|
|
electron: {
|
|
|
|
|
build: [
|
|
|
|
|
{
|
|
|
|
|
// Main-Process entry file of the Electron App.
|
2024-01-09 16:24:38 +01:00
|
|
|
entry: "electron/main.ts"
|
|
|
|
|
},
|
|
|
|
|
{
|
2024-01-10 18:14:33 +01:00
|
|
|
entry: "electron/preload.ts",
|
2024-01-09 16:24:38 +01:00
|
|
|
onstart(args) {
|
|
|
|
|
// Notify the Renderer-Process to reload the page when the Preload-Scripts build is complete,
|
|
|
|
|
// instead of restarting the entire Electron App.
|
|
|
|
|
args.reload();
|
|
|
|
|
},
|
2024-01-04 15:38:50 +01:00
|
|
|
},
|
|
|
|
|
],
|
2024-01-09 16:24:38 +01:00
|
|
|
renderer: {},
|
2024-01-04 15:38:50 +01:00
|
|
|
},
|
2023-10-17 16:03:08 +02:00
|
|
|
devtools: { enabled: false },
|
2023-10-13 17:39:22 +02:00
|
|
|
app: {
|
2024-01-10 18:14:33 +01:00
|
|
|
pageTransition: { name: "page", mode: "out-in" },
|
2023-10-16 16:35:11 +02:00
|
|
|
// Global page headers: https://go.nuxtjs.dev/config-head
|
2023-10-13 17:39:22 +02:00
|
|
|
head: {
|
2025-06-26 10:48:40 +02:00
|
|
|
title: "UWIL Expo by LDC",
|
2023-10-13 17:39:22 +02:00
|
|
|
meta: [
|
|
|
|
|
{ charset: "utf-8" },
|
|
|
|
|
{ name: "viewport", content: "width=device-width, initial-scale=1" },
|
|
|
|
|
{ hid: "description", name: "description", content: "" },
|
|
|
|
|
{ name: "format-detection", content: "telephone=no" },
|
|
|
|
|
],
|
|
|
|
|
link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
|
2024-01-10 18:14:33 +01:00
|
|
|
bodyAttrs: {
|
|
|
|
|
"data-bs-theme": "light"
|
|
|
|
|
}
|
2023-10-13 17:39:22 +02:00
|
|
|
},
|
2023-10-13 16:18:44 +02:00
|
|
|
},
|
2023-10-16 16:35:11 +02:00
|
|
|
plugins: [
|
2024-01-15 17:53:16 +01:00
|
|
|
{ src: "~/plugins/toolboxhelper.ts", mode: "client" },
|
2023-10-17 15:43:44 +02:00
|
|
|
{ src: "~/plugins/boostrap.ts", mode: "client" },
|
|
|
|
|
{ src: "~/plugins/fontawesome.ts", mode: "client" },
|
|
|
|
|
{ src: "~/plugins/localStorage.ts", mode: "client" },
|
2024-01-11 16:51:31 +01:00
|
|
|
{ src: "~/plugins/emitter.ts", mode: "client" },
|
2023-10-16 16:35:11 +02:00
|
|
|
],
|
2023-10-13 17:39:22 +02:00
|
|
|
alias: {
|
2024-01-11 09:39:06 +01:00
|
|
|
// images: resolve(__dirname, "./static/assets/images"),
|
2023-10-13 17:39:22 +02:00
|
|
|
data: resolve(__dirname, "./static/data"),
|
2024-01-11 15:21:59 +01:00
|
|
|
pinia: "/node_modules/@pinia/nuxt/node_modules/pinia/dist/pinia.mjs"
|
2024-01-16 18:15:07 +01:00
|
|
|
},
|
|
|
|
|
i18n: {
|
2026-09-01 15:17:48 +02:00
|
|
|
locales: UnzipData.loadJsonDataFile()?.settings.locales ?? ["fr"],
|
2024-01-17 17:44:12 +01:00
|
|
|
defaultLocale: "fr",
|
2024-01-17 11:37:59 +01:00
|
|
|
// * Ajouter aussi la locale dans ce fichier
|
|
|
|
|
vueI18n: "./i18n.config.ts"
|
2023-10-17 15:43:44 +02:00
|
|
|
}
|
2023-10-13 17:39:22 +02:00
|
|
|
});
|