Tree-shake Vuestic and chunking performance

This commit is contained in:
2024-05-26 23:17:52 +02:00
parent 4fd8628f64
commit d436838a79
7 changed files with 199 additions and 15 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ import piniaPluginPersistedstate from 'pinia-plugin-persistedstate';
import App from './App.vue';
import router from './router';
import { createVuestic } from 'vuestic-ui';
import { createVuesticEssential } from 'vuestic-ui';
import { i18n } from '@/i18n';
const app = createApp(App);
@@ -15,5 +15,5 @@ app
.use(i18n)
.use(createPinia().use(piniaPluginPersistedstate))
.use(router)
.use(createVuestic())
.use(createVuesticEssential())
.mount('#app');
-3
View File
@@ -1,5 +1,3 @@
import _amenities from './data/amenities.json';
export type OSMAmenity = {
value: string;
in_wiki: boolean;
@@ -8,7 +6,6 @@ export type OSMAmenity = {
de?: string;
};
};
export const amenities: OSMAmenity[] = _amenities;
export interface APIElement {
id: string;
+3 -2
View File
@@ -1,8 +1,9 @@
<script setup lang="ts">
import { amenities } from '@/osm';
import amenities from '@/data/amenities.json';
import { useMapStore } from '@/stores/map';
import { useThemeStore } from '@/stores/theme';
import { useI18n } from 'vue-i18n';
import type { OSMAmenity } from '@/osm';
const theme = useThemeStore();
const mapStore = useMapStore();
@@ -40,7 +41,7 @@ const i18n = useI18n();
>
<VaVirtualScroller
v-slot="{ item }"
:items="amenities"
:items="amenities as OSMAmenity[]"
wrapper-size="30rem"
>
<VaCheckbox