Files
2026-06-11 08:40:19 +00:00

125 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",
],
frappe: ["assignment_rule"],
},
},
}),
vue(),
vueJsx(),
VitePWA({
registerType: "autoUpdate",
devOptions: {
enabled: true,
},
workbox: {
cleanupOutdatedCaches: true,
maximumFileSizeToCacheInBytes: 5 * 1024 * 1024,
},
manifest: {
display: "standalone",
name: "Frappe Helpdesk",
short_name: "Helpdesk",
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;
});