ldc-showroom/nuxt.config.ts
2025-06-26 11:12:53 +02:00

78 lines
2.7 KiB
TypeScript

import { resolve } from "path";
import UnzipData from "./electron/UnzipData";
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
hooks: {
"build:before": () => {
if (["typecheck", "postinstall"].filter(action => action === process.env.npm_lifecycle_event).length) {
return;
}
UnzipData.loadZipFileContent();
}
},
experimental: {
polyfillVueUseHead: false
},
components: [
{ path: "~/components", pathPrefix: false }
],
imports: {
dirs: ["stores", "composables"],
},
// * @pinia/nuxt doit être le dernier dans la liste (source stackoverflow)
modules: ["nuxt-electron", "@nuxtjs/i18n", "@pinia/nuxt"],
electron: {
build: [
{
// Main-Process entry file of the Electron App.
entry: "electron/main.ts"
},
{
entry: "electron/preload.ts",
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();
},
},
],
renderer: {},
},
devtools: { enabled: false },
app: {
pageTransition: { name: "page", mode: "out-in" },
// Global page headers: https://go.nuxtjs.dev/config-head
head: {
title: "UWIL Expo by LDC",
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" }],
bodyAttrs: {
"data-bs-theme": "light"
}
},
},
plugins: [
{ src: "~/plugins/toolboxhelper.ts", mode: "client" },
{ src: "~/plugins/boostrap.ts", mode: "client" },
{ src: "~/plugins/fontawesome.ts", mode: "client" },
{ src: "~/plugins/localStorage.ts", mode: "client" },
{ src: "~/plugins/emitter.ts", mode: "client" },
],
alias: {
// images: resolve(__dirname, "./static/assets/images"),
data: resolve(__dirname, "./static/data"),
pinia: "/node_modules/@pinia/nuxt/node_modules/pinia/dist/pinia.mjs"
},
i18n: {
locales: ["fr", "en", "de", "es", "nl"],
defaultLocale: "fr",
// * Ajouter aussi la locale dans ce fichier
vueI18n: "./i18n.config.ts"
}
});