added dynamical import of components via vite
This commit is contained in:
@ -4,9 +4,8 @@
|
||||
export let name = '';
|
||||
|
||||
async function getComponent(componentName) {
|
||||
if (components[componentName]) return components[componentName];
|
||||
if (componentName === 'Composite') {
|
||||
const module = await import('$lib/components/Composite.svelte');
|
||||
if (components[componentName]) {
|
||||
const module = await components[componentName]();
|
||||
return module.default;
|
||||
}
|
||||
return null;
|
||||
@ -26,5 +25,3 @@
|
||||
{/if}
|
||||
{/await}
|
||||
{/each}
|
||||
|
||||
<p>Composite: {name}</p>
|
||||
|
Reference in New Issue
Block a user