refactor: moved boot variable loading code in vite
This commit is contained in:
parent
8cb0b9aec0
commit
10c65f3d6c
@ -177,14 +177,6 @@
|
|||||||
</head>
|
</head>
|
||||||
<body class="sm:overscroll-y-none no-scrollbar">
|
<body class="sm:overscroll-y-none no-scrollbar">
|
||||||
<div id="app" class="h-full"></div>
|
<div id="app" class="h-full"></div>
|
||||||
<div id="modals"></div>
|
|
||||||
<div id="popovers"></div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
{% for key in boot %}
|
|
||||||
window["{{ key }}"] = {{ boot[key] | tojson }};
|
|
||||||
{% endfor %}
|
|
||||||
</script>
|
|
||||||
<script type="module" src="/src/main.js"></script>
|
<script type="module" src="/src/main.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
@ -24,8 +24,9 @@ export default defineConfig({
|
|||||||
display: 'standalone',
|
display: 'standalone',
|
||||||
name: 'Frappe CRM',
|
name: 'Frappe CRM',
|
||||||
short_name: 'Frappe CRM',
|
short_name: 'Frappe CRM',
|
||||||
start_url: "/crm",
|
start_url: '/crm',
|
||||||
description: 'Modern & 100% Open-source CRM tool to supercharge your sales operations',
|
description:
|
||||||
|
'Modern & 100% Open-source CRM tool to supercharge your sales operations',
|
||||||
icons: [
|
icons: [
|
||||||
{
|
{
|
||||||
src: '/assets/crm/manifest/manifest-icon-192.maskable.png',
|
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>/,
|
||||||
|
`
|
||||||
|
<script>
|
||||||
|
{% for key in boot %}
|
||||||
|
window["{{ key }}"] = {{ boot[key] | tojson }};
|
||||||
|
{% endfor %}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
`
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return html
|
||||||
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user