ldc-showroom/nuxt.config.ts

80 lines
2.7 KiB
TypeScript
Raw Permalink Normal View History

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
},
components: [
{ path: "~/components", pathPrefix: false }
],
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.
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();
},
2024-01-04 15:38:50 +01:00
},
],
renderer: {},
2024-01-04 15:38:50 +01:00
},
2023-10-17 16:03:08 +02:00
devtools: { enabled: false },
app: {
pageTransition: { name: "page", mode: "out-in" },
2023-10-16 16:35:11 +02:00
// 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"
}
},
2023-10-13 16:18:44 +02:00
},
2023-10-16 16:35:11 +02:00
plugins: [
{ 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" },
{ src: "~/plugins/emitter.ts", mode: "client" },
2023-10-16 16:35:11 +02:00
],
alias: {
2024-01-11 09:39:06 +01:00
// images: resolve(__dirname, "./static/assets/images"),
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: {
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
}
});