Files
helpdesk/desk/vite.config.js
zooqueen 5d7054c177 Carry the Hanzo mark across the Help Center
The desk SPA's titles, marks and install icons come from this repo's own
source, so they change here: the shell title and apple title, the PWA
manifest name, the sidebar and welcome-ticket copy, the fallback logo
component, the SPA favicon and the 180/192/512 install icons.

The login page, navbar, footer and favicon are rendered by the Frappe core,
which reads those marks from Website Settings / Navbar Settings / System
Settings at run time. helpdesk/brand.py writes them and the entrypoint runs
it per site on every boot, next to the SSO setup. Each field is set to a
constant and guarded on the field existing, so a boot against a site that
already exists restores the same values instead of failing.

The marks are served from this app's own public directory
(helpdesk/public -> /assets/helpdesk), so no page reaches a third-party host
for a logo.
2026-08-13 23:19:08 -07:00

126 lines
3.3 KiB
JavaScript

import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
import path from "path";
import { defineConfig } from "vite";
import { VitePWA } from "vite-plugin-pwa";
import {
getLocalFrappeUIDevConfig,
importFrappeUIPlugin,
} from "./vite-helpers";
export default defineConfig(async ({ mode }) => {
const { useLocalFrappeUI, localFrappeUIAliases } = getLocalFrappeUIDevConfig({
mode,
rootDir: __dirname,
});
const frappeui = await importFrappeUIPlugin({ useLocalFrappeUI });
const config = {
plugins: [
frappeui({
frappeProxy: true,
lucideIcons: true,
jinjaBootData: true,
buildConfig: {
outDir: `../helpdesk/public/desk`,
emptyOutDir: true,
indexHtmlPath: "../helpdesk/www/helpdesk/index.html",
},
frappeTypes: {
input: {
helpdesk: [
"hd_ticket_status",
"hd_ticket",
"hd_service_holiday_list",
"hd_service_level_agreement",
"hd_agent",
"hd_team",
"hd_customer",
],
frappe: ["assignment_rule", "contact"],
},
},
}),
vue(),
vueJsx(),
VitePWA({
registerType: "autoUpdate",
devOptions: {
enabled: true,
},
workbox: {
cleanupOutdatedCaches: true,
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
},
manifest: {
display: "standalone",
name: "Hanzo Help Center",
short_name: "Help Center",
start_url: "/helpdesk",
description:
"Modern, Streamlined, Free and Open Source Customer Service Software",
icons: [
{
src: "/assets/helpdesk/desk/manifest/manifest-icon-192.maskable.png",
sizes: "192x192",
type: "image/png",
purpose: "any",
},
{
src: "/assets/helpdesk/desk/manifest/manifest-icon-192.maskable.png",
sizes: "192x192",
type: "image/png",
purpose: "maskable",
},
{
src: "/assets/helpdesk/desk/manifest/manifest-icon-512.maskable.png",
sizes: "512x512",
type: "image/png",
purpose: "any",
},
{
src: "/assets/helpdesk/desk/manifest/manifest-icon-512.maskable.png",
sizes: "512x512",
type: "image/png",
purpose: "maskable",
},
],
},
}),
],
server: {
allowedHosts: true,
fs: {
allow: [".."],
},
},
resolve: {
alias: {
"@": path.resolve(__dirname, "src"),
"tailwind.config.js": path.resolve(__dirname, "tailwind.config.js"),
// ...localFrappeUIAliases,
},
dedupe: [
"prosemirror-view",
"prosemirror-gapcursor",
"prosemirror-tables",
],
},
optimizeDeps: {
include: [
"feather-icons",
"tailwind.config.js",
"prosemirror-state",
"prosemirror-view",
"prosemirror-gapcursor",
"prosemirror-tables",
"lowlight",
"interactjs",
],
exclude: ["frappe-ui"],
},
};
return config;
});