refactor: moved boot variable loading code in vite
This commit is contained in:
parent
8cb0b9aec0
commit
10c65f3d6c
@ -177,14 +177,6 @@
|
||||
</head>
|
||||
<body class="sm:overscroll-y-none no-scrollbar">
|
||||
<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>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@ -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>/,
|
||||
`
|
||||
<script>
|
||||
{% for key in boot %}
|
||||
window["{{ key }}"] = {{ boot[key] | tojson }};
|
||||
{% endfor %}
|
||||
</script>
|
||||
</body>
|
||||
`
|
||||
)
|
||||
}
|
||||
return html
|
||||
},
|
||||
},
|
||||
],
|
||||
resolve: {
|
||||
alias: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user