From 10c65f3d6ce22b174652fcc6068166b77dea03f0 Mon Sep 17 00:00:00 2001 From: Shariq Ansari Date: Mon, 3 Jun 2024 19:04:15 +0530 Subject: [PATCH] refactor: moved boot variable loading code in vite --- frontend/index.html | 8 -------- frontend/vite.config.js | 24 ++++++++++++++++++++++-- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/frontend/index.html b/frontend/index.html index 7145d7ca..351990a3 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -177,14 +177,6 @@
-
-
- - diff --git a/frontend/vite.config.js b/frontend/vite.config.js index acc963c0..292f13fe 100644 --- a/frontend/vite.config.js +++ b/frontend/vite.config.js @@ -24,8 +24,9 @@ export default defineConfig({ display: 'standalone', name: 'Frappe CRM', short_name: 'Frappe CRM', - start_url: "/crm", - description: 'Modern & 100% Open-source CRM tool to supercharge your sales operations', + start_url: '/crm', + description: + 'Modern & 100% Open-source CRM tool to supercharge your sales operations', icons: [ { src: '/assets/crm/manifest/manifest-icon-192.maskable.png', @@ -54,6 +55,25 @@ export default defineConfig({ ], }, }), + { + name: 'transform-index.html', + transformIndexHtml(html, context) { + if (!context.server) { + return html.replace( + /<\/body>/, + ` + + + ` + ) + } + return html + }, + }, ], resolve: { alias: {